@stacksjs/dtsx 0.9.13 → 0.9.14
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/README.md +5 -3
- package/dist/bin/cli.js +6 -6
- package/dist/branded-types.d.ts +10 -18
- package/dist/chunk-1bge31tv.js +2 -0
- package/dist/chunk-27nzyfdd.js +2 -0
- package/dist/chunk-285mqzvx.js +16 -0
- package/dist/chunk-2n1bbm2c.js +448 -0
- package/dist/chunk-3w5aqasc.js +33 -0
- package/dist/chunk-3xqchdwd.js +2 -0
- package/dist/chunk-7tyhhk7c.js +2 -0
- package/dist/chunk-8kz02py2.js +2 -0
- package/dist/{chunk-pdt5pc9f.js → chunk-abhx1v3w.js} +1 -1
- package/dist/chunk-ayvw3402.js +2 -0
- package/dist/chunk-cbz06k9p.js +2 -0
- package/dist/chunk-d1xj2pjv.js +24 -0
- package/dist/chunk-dk914hsr.js +2 -0
- package/dist/chunk-dzgms5s6.js +80 -0
- package/dist/{chunk-hbd2nj9p.js → chunk-enqtx6te.js} +1 -1
- package/dist/{chunk-57agx6g8.js → chunk-gssantc8.js} +1 -1
- package/dist/chunk-j1zrbs2z.js +2 -0
- package/dist/{chunk-emwe4zbk.js → chunk-j8zksbkn.js} +1 -1
- package/dist/{chunk-ns3hznyf.js → chunk-mcdb3q06.js} +1 -1
- package/dist/{chunk-0f9tt1yd.js → chunk-mwfja9e3.js} +1 -1
- package/dist/{chunk-mrk48ejm.js → chunk-mxam9312.js} +8 -8
- package/dist/chunk-nf54b52t.js +6 -0
- package/dist/{chunk-e0gx49tv.js → chunk-p50ms07x.js} +1 -1
- package/dist/{chunk-tzrvp0n2.js → chunk-pj8142by.js} +1 -1
- package/dist/chunk-pt2txw6z.js +2 -0
- package/dist/chunk-r6v1qdqb.js +6 -0
- package/dist/chunk-rsv17jh8.js +3 -0
- package/dist/{chunk-ck86m3vf.js → chunk-sw3m29sw.js} +1 -1
- package/dist/chunk-thhd43x5.js +19 -0
- package/dist/{chunk-a592hfkt.js → chunk-tne5n3h1.js} +1 -1
- package/dist/{chunk-1t76q5wk.js → chunk-trm0gptj.js} +1 -1
- package/dist/{chunk-188ep5ns.js → chunk-vgm83r4p.js} +1 -1
- package/dist/chunk-vpjw38x7.js +34 -0
- package/dist/chunk-wzq881r8.js +4 -0
- package/dist/chunk-x4v9kajr.js +3 -0
- package/dist/{chunk-e38jw5aa.js → chunk-xmje6xfw.js} +1 -1
- package/dist/{chunk-vf7ywnxz.js → chunk-xtee8g1a.js} +1 -1
- package/dist/{chunk-f0mvmcmj.js → chunk-y6m8mmyg.js} +1 -1
- package/dist/{chunk-6qv7p9sg.js → chunk-zf17s33e.js} +18 -11
- package/dist/compat.d.ts +5 -2
- package/dist/extractor/cache.d.ts +6 -2
- package/dist/extractor/directives.d.ts +0 -4
- package/dist/generator.d.ts +1 -1
- package/dist/logger.d.ts +4 -0
- package/dist/optimizer.d.ts +4 -0
- package/dist/process-source.d.ts +1 -0
- package/dist/processor/cache.d.ts +4 -2
- package/dist/processor/imports.d.ts +1 -0
- package/dist/src/index.js +52 -51
- package/dist/src/plugins/bun.js +1 -1
- package/dist/src/plugins/esbuild.js +1 -1
- package/dist/src/plugins/index.js +1 -1
- package/dist/src/plugins/tsup.js +1 -1
- package/dist/src/plugins/vite.js +1 -1
- package/dist/src/plugins/webpack.js +1 -1
- package/dist/transformers.d.ts +4 -1
- package/dist/type-mappings.d.ts +16 -16
- package/dist/types.d.ts +2 -0
- package/package.json +3 -3
- package/dist/chunk-2vw7w2j4.js +0 -23
- package/dist/chunk-365avtde.js +0 -32
- package/dist/chunk-446n992h.js +0 -2
- package/dist/chunk-49b3ran6.js +0 -4
- package/dist/chunk-50hbgzrj.js +0 -3
- package/dist/chunk-6jpqpjkc.js +0 -3
- package/dist/chunk-94h87sgb.js +0 -449
- package/dist/chunk-at36dtgx.js +0 -2
- package/dist/chunk-b0bkjk0p.js +0 -19
- package/dist/chunk-chbk4344.js +0 -2
- package/dist/chunk-ez568rby.js +0 -2
- package/dist/chunk-hwm87z68.js +0 -2
- package/dist/chunk-jfk0hw36.js +0 -75
- package/dist/chunk-myvmq7hz.js +0 -2
- package/dist/chunk-nd0xbpbz.js +0 -2
- package/dist/chunk-nfeqwqca.js +0 -6
- package/dist/chunk-nr1gxnen.js +0 -2
- package/dist/chunk-pdvve1gm.js +0 -33
- package/dist/chunk-sv136qag.js +0 -17
- package/dist/chunk-te9r0j9z.js +0 -6
- package/dist/chunk-trftkghj.js +0 -2
- package/dist/chunk-xqymptjk.js +0 -2
- package/dist/extractor/extract.d.ts +0 -10
- package/dist/extractor/scanner.d.ts +0 -6
package/dist/chunk-at36dtgx.js
DELETED
package/dist/chunk-b0bkjk0p.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{hc as D}from"./chunk-94h87sgb.js";import{kc as p,lc as Jq,mc as Oq}from"./chunk-50hbgzrj.js";import{Ec as wq}from"./chunk-sv136qag.js";import{ad as E}from"./chunk-ns3hznyf.js";var z=E(D(),1);var I=E(D(),1);var A=new Map,S=new Map,Gq=100;function _q(){if(A.size<=Gq)return;let q=null,$=1/0;for(let[W,Q]of A)if(Q.lastAccess<$)$=Q.lastAccess,q=W;if(q)A.delete(q)}function jq(){A.clear()}function Bq(){return A.size}var Uq={asyncThreshold:1e5,chunkSize:50000,yieldInterval:0};function u(q){return new Promise(($)=>{if(q===0)if(typeof setImmediate<"u")setImmediate($);else setTimeout($,0);else setTimeout($,q)})}async function zq(q,$,W){if($.length<W.asyncThreshold)return I.createSourceFile(q,$,I.ScriptTarget.Latest,!0,I.ScriptKind.TS);await u(W.yieldInterval);let Q=I.createSourceFile(q,$,I.ScriptTarget.Latest,!1,I.ScriptKind.TS);return await u(W.yieldInterval),Q}async function g(q,$,W={}){let Q={...Uq,...W},V=p($),j=q,U=Date.now(),X=A.get(j);if(X&&X.contentHash===V)return X.lastAccess=U,X.sourceFile;let Z=S.get(j);if(Z)return Z;let w=(async()=>{try{let H=await zq(q,$,Q);return A.set(j,{sourceFile:H,contentHash:V,lastAccess:U}),_q(),H}finally{S.delete(j)}})();return S.set(j,w),w}async function Lq(q,$={}){let W=$.concurrency??4,Q=new Map,V=[];for(let j=0;j<q.length;j+=W){let U=q.slice(j,j+W),X=await Promise.allSettled(U.map(async({filePath:Z,sourceCode:w})=>{let H=await g(Z,w,$);return{filePath:Z,sourceFile:H}}));for(let Z of X)if(Z.status==="fulfilled")Q.set(Z.value.filePath,Z.value.sourceFile);else V.push({filePath:U[X.indexOf(Z)].filePath,error:Z.reason});if(j+W<q.length)await u(0)}if(V.length>0)console.warn(`[dtsx] ${V.length} file(s) failed to parse:`,V.map((j)=>j.filePath));return Q}function Iq(q,$={}){let W=$.asyncThreshold??Uq.asyncThreshold;return q.length>=W}function vq(){return S.size}var R=E(D(),1);var Y=E(D(),1);var B=E(D(),1);function M(q,$,W){return $.slice(W?q.getStart(W):q.getStart(),q.getEnd())}function L(q,$){let W=[],Q=q.getFullStart(),V=q.getStart($);if(Q!==V){let j=$.text.substring(Q,V),U=j.match(/\/\*\*[\s\S]*?\*\//g);if(U)W.push(...U);let X=j.match(/\/\*(?!\*)[\s\S]*?\*\//g);if(X)W.push(...X);let Z=j.split(`
|
|
3
|
-
`),w=[];for(let H=Z.length-1;H>=0;H--){let O=Z[H].trim();if(O.startsWith("//"))w.unshift(O);else if(O==="")continue;else break}if(w.length>0)W.push(w.join(`
|
|
4
|
-
`))}return W}function P(q,$){if(B.isObjectBindingPattern(q.name)){let W=q.name.elements.map((Q)=>{if(B.isBindingElement(Q)&&B.isIdentifier(Q.name))return Q.name.getText($);return""}).filter(Boolean);if(W.length>3)return`{
|
|
5
|
-
${W.join(`,
|
|
6
|
-
`)},
|
|
7
|
-
}`;return`{ ${W.join(", ")} }`}else if(B.isArrayBindingPattern(q.name))return`[${q.name.elements.map((Q)=>{if(Q&&B.isBindingElement(Q)&&B.isIdentifier(Q.name))return Q.name.getText($);return""}).filter(Boolean).join(", ")}]`;else return q.name.getText($)}function _(q){if(!("modifiers"in q)||!q.modifiers)return!1;return q.modifiers.some((W)=>W.kind===B.SyntaxKind.ExportKeyword)}function l(q){return q.modifiers?.some(($)=>$.kind===B.SyntaxKind.AsyncKeyword)||!1}function c(q,$){return!1}var N=new Map;function d(q,$){let W=N.get(q);if(!W){let Q=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(W={funcPattern:new RegExp(`export\\s+[^\\n]*:\\s*[^\\n]*\\b${Q}\\b`,"gm"),typePattern:new RegExp(`export\\s+[^\\n]*\\b${Q}\\b`,"gm")},N.set(q,W),N.size>200){let V=Array.from(N.keys()).slice(0,50);for(let j of V)N.delete(j)}}return W.funcPattern.lastIndex=0,W.typePattern.lastIndex=0,W.funcPattern.test($)||W.typePattern.test($)}var Pq=new Set(["string","number","boolean","object","any","unknown","never","void","undefined","null","Array","Promise","Record","Partial","Required","Pick","Omit","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisType","Function","Date","RegExp","Error","Map","Set","WeakMap","WeakSet","T","K","V","U","R","P","E","A","B","C","D","F","G","H","I","J","L","M","N","O","Q","S","W","X","Y","Z"]);function m(q){return Pq.has(q)}function i(q){let $=[],W=q.match(/(?:export\s+)?interface\s+([A-Z][a-zA-Z0-9]*)/g);if(W)W.forEach((U)=>{let X=U.replace(/(?:export\s+)?interface\s+/,"");$.push(X)});let Q=q.match(/(?:export\s+)?type\s+([A-Z][a-zA-Z0-9]*)/g);if(Q)Q.forEach((U)=>{let X=U.replace(/(?:export\s+)?type\s+/,"");$.push(X)});let V=q.match(/(?:export\s+)?(?:declare\s+)?class\s+([A-Z][a-zA-Z0-9]*)/g);if(V)V.forEach((U)=>{let X=U.replace(/(?:export\s+)?(?:declare\s+)?class\s+/,"");$.push(X)});let j=q.match(/(?:export\s+)?(?:declare\s+)?(?:const\s+)?enum\s+([A-Z][a-zA-Z0-9]*)/g);if(j)j.forEach((U)=>{let X=U.replace(/(?:export\s+)?(?:declare\s+)?(?:const\s+)?enum\s+/,"");$.push(X)});return $}var Kq=/\s+as\s+(\S+)\s*$/;function K(q,$){let W=q.trim();if(!W.endsWith("as const")){let V=W.match(Kq);if(V)return V[1]}let Q=wq(W,$);if(Q==="unknown")return"unknown";if(!$){if(Q==="true"||Q==="false")return"boolean";if(/^-?\d+(\.\d+)?$/.test(Q))return"number";if(Q.startsWith('"')&&Q.endsWith('"')||Q.startsWith("'")&&Q.endsWith("'"))return"string"}return Q}function t(q,$){let W=[],Q=q.modifiers?.some((X)=>X.kind===Y.SyntaxKind.AsyncKeyword),V=!!q.asteriskToken;if(_(q))W.push("export ");if(W.push("declare function "),q.name)W.push(q.name.getText($));if(q.typeParameters){let X=q.typeParameters.map((Z)=>Z.getText($)).join(", ");W.push("<",X,">")}let j=q.parameters.map((X)=>{let Z=P(X,$),w=X.type?.getText($)||(X.initializer?K(X.initializer.getText($),!1):"unknown"),H=X.questionToken||X.initializer?"?":"";if(!!X.dotDotDotToken)return`...${Z}: ${w}`;return`${Z}${H}: ${w}`}).join(", ");W.push("(",j,")");let U=q.type?.getText($);if(!U)if(Q&&V)U="AsyncGenerator<unknown, void, unknown>";else if(V)U="Generator<unknown, void, unknown>";else if(Q)U="Promise<void>";else U="void";return W.push(": ",U,";"),W.join("")}function a(q,$,W,Q){let V=[];if(Q)V.push("export ");if(V.push("declare ",W," ",q),$)V.push(": ",$);return V.push(";"),V.join("")}function n(q,$,W){let Q=[];if($)Q.push("export ");if(Q.push("declare interface ",q.name.getText(W)),q.typeParameters){let j=q.typeParameters.map((U)=>U.getText(W)).join(", ");Q.push("<",j,">")}if(q.heritageClauses){let j=q.heritageClauses.find((U)=>U.token===Y.SyntaxKind.ExtendsKeyword);if(j){let U=j.types.map((X)=>X.getText(W)).join(", ");Q.push(" extends ",U)}}let V=r(q,W);return Q.push(" ",V),Q.join("")}function Yq(q,$){if(!q.name)return"";return q.name.getText($)}function r(q,$){let W=[];for(let Q of q.members)if(Y.isPropertySignature(Q)){let V=Yq(Q,$),j=Q.type?.getText($)||"unknown",U=Q.questionToken?"?":"",X=Q.modifiers?.some((Z)=>Z.kind===Y.SyntaxKind.ReadonlyKeyword)?"readonly ":"";W.push(` ${X}${V}${U}: ${j}`)}else if(Y.isMethodSignature(Q)){let V=Yq(Q,$),j="";if(Q.typeParameters&&Q.typeParameters.length>0)j=`<${Q.typeParameters.map((w)=>w.getText($)).join(", ")}>`;let U=Q.parameters.map((w)=>{let H=w.name.getText($),O=w.type?.getText($)||"unknown",J=w.questionToken?"?":"";if(!!w.dotDotDotToken)return`...${H}: ${O}`;return`${H}${J}: ${O}`}).join(", "),X=Q.type?.getText($)||"void",Z=Q.questionToken?"?":"";W.push(` ${V}${Z}${j}(${U}): ${X}`)}else if(Y.isCallSignatureDeclaration(Q)){let V=Q.parameters.map((U)=>{let X=U.name.getText($),Z=U.type?.getText($)||"unknown",w=U.questionToken?"?":"";if(!!U.dotDotDotToken)return`...${X}: ${Z}`;return`${X}${w}: ${Z}`}).join(", "),j=Q.type?.getText($)||"void";W.push(` (${V}): ${j}`)}else if(Y.isConstructSignatureDeclaration(Q)){let V=Q.parameters.map((U)=>{let X=U.name.getText($),Z=U.type?.getText($)||"unknown",w=U.questionToken?"?":"";if(!!U.dotDotDotToken)return`...${X}: ${Z}`;return`${X}${w}: ${Z}`}).join(", "),j=Q.type?.getText($)||"unknown";W.push(` new (${V}): ${j}`)}else if(Y.isIndexSignatureDeclaration(Q)){let V=Q.parameters.map((U)=>{let X=U.name.getText($),Z=U.type?.getText($)||"any";return`${X}: ${Z}`}).join(", "),j=Q.type?.getText($)||"unknown";W.push(` [${V}]: ${j}`)}return`{
|
|
8
|
-
${W.join(`
|
|
9
|
-
`)}
|
|
10
|
-
}`}function s(q,$,W){let Q=[];if($)Q.push("export ");if(Q.push("type ",q.name.getText(W)),q.typeParameters){let V=q.typeParameters.map((j)=>j.getText(W)).join(", ");Q.push("<",V,">")}return Q.push(" = ",q.type.getText(W)),Q.join("")}function o(q,$,W){let Q=[];if($)Q.push("export ");if(Q.push("declare "),q.modifiers?.some((X)=>X.kind===Y.SyntaxKind.AbstractKeyword))Q.push("abstract ");if(Q.push("class ",q.name?.getText(W)||"AnonymousClass"),q.typeParameters){let X=q.typeParameters.map((Z)=>Z.getText(W)).join(", ");Q.push("<",X,">")}let j=q.heritageClauses?.find((X)=>X.token===Y.SyntaxKind.ExtendsKeyword)?.types[0]?.getText(W);if(j)Q.push(" extends ",j);let U=q.heritageClauses?.find((X)=>X.token===Y.SyntaxKind.ImplementsKeyword)?.types.map((X)=>X.getText(W));if(U&&U.length>0)Q.push(" implements ",U.join(", "));return Q.push(" ",Hq(q,W)),Q.join("")}function T(q,$,W,Q,V){let j=[" "];if(Q)j.push("private ");else if(V)j.push("protected ");if(q)j.push("static ");if($)j.push("abstract ");if(W)j.push("readonly ");return j.join("")}function h(q){return q.name?Y.isPrivateIdentifier(q.name):!1}function b(q,$){if(!q.name)return"";return q.name.getText($)}function Hq(q,$){let W=[];for(let Q of q.members){if(Q.kind===Y.SyntaxKind.ClassStaticBlockDeclaration)continue;if(Y.isConstructorDeclaration(Q)){for(let j of Q.parameters)if(j.modifiers&&j.modifiers.length>0){if(j.modifiers.some((J)=>J.kind===Y.SyntaxKind.PrivateKeyword))continue;let X=P(j,$),Z=j.type?.getText($)||(j.initializer?K(j.initializer.getText($),!1):"unknown"),w=j.questionToken||j.initializer?"?":"",H=j.modifiers.map((J)=>J.getText($)).join(" "),O=H?`${H} `:"";W.push(` ${O}${X}${w}: ${Z};`)}let V=Q.parameters.map((j)=>{let U=P(j,$),X=j.type?.getText($)||(j.initializer?K(j.initializer.getText($),!1):"unknown"),Z=j.questionToken||j.initializer?"?":"";return`${U}${Z}: ${X}`}).join(", ");W.push(` constructor(${V});`)}else if(Y.isMethodDeclaration(Q)){if(h(Q))continue;if(Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.PrivateKeyword))continue;let j=b(Q,$),U=!!Q.asteriskToken,Z=[T(!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.StaticKeyword),!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.AbstractKeyword),!1,!1,!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.ProtectedKeyword))];if(U)Z.push("*");if(Z.push(j),Q.typeParameters){let J=Q.typeParameters.map((G)=>G.getText($)).join(", ");Z.push("<",J,">")}let w=Q.parameters.map((J)=>{let G=P(J,$),k=J.type?.getText($)||(J.initializer?K(J.initializer.getText($),!1):"unknown"),v=J.questionToken||J.initializer?"?":"";return`${G}${v}: ${k}`}).join(", ");Z.push("(",w,")");let H=!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.AsyncKeyword),O=Q.type?.getText($);if(!O)if(H&&U)O="AsyncGenerator<unknown, void, unknown>";else if(U)O="Generator<unknown, void, unknown>";else if(H)O="Promise<void>";else O="void";Z.push(": ",O,";"),W.push(Z.join(""))}else if(Y.isPropertyDeclaration(Q)){if(h(Q))continue;if(Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.PrivateKeyword))continue;let j=b(Q,$),U=T(!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.StaticKeyword),!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.AbstractKeyword),!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.ReadonlyKeyword),!1,!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.ProtectedKeyword)),X=Q.questionToken?"?":"",Z=!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.StaticKeyword),w=!!Q.modifiers?.some((J)=>J.kind===Y.SyntaxKind.ReadonlyKeyword),H=Z&&w,O=Q.type?.getText($)||(Q.initializer?K(Q.initializer.getText($),H):"unknown");W.push(`${U}${j}${X}: ${O};`)}else if(Y.isGetAccessorDeclaration(Q)){if(h(Q))continue;if(Q.modifiers?.some((Z)=>Z.kind===Y.SyntaxKind.PrivateKeyword))continue;let j=b(Q,$),U=T(!!Q.modifiers?.some((Z)=>Z.kind===Y.SyntaxKind.StaticKeyword),!!Q.modifiers?.some((Z)=>Z.kind===Y.SyntaxKind.AbstractKeyword),!1,!1,!!Q.modifiers?.some((Z)=>Z.kind===Y.SyntaxKind.ProtectedKeyword)),X=Q.type?.getText($)||"unknown";W.push(`${U}get ${j}(): ${X};`)}else if(Y.isSetAccessorDeclaration(Q)){if(h(Q))continue;if(Q.modifiers?.some((H)=>H.kind===Y.SyntaxKind.PrivateKeyword))continue;let j=b(Q,$),U=T(!!Q.modifiers?.some((H)=>H.kind===Y.SyntaxKind.StaticKeyword),!!Q.modifiers?.some((H)=>H.kind===Y.SyntaxKind.AbstractKeyword),!1,!1,!!Q.modifiers?.some((H)=>H.kind===Y.SyntaxKind.ProtectedKeyword)),X=Q.parameters[0],Z=X?.type?.getText($)||"unknown",w=X?.name?.getText($)||"value";W.push(`${U}set ${j}(${w}: ${Z});`)}}return`{
|
|
11
|
-
${W.join(`
|
|
12
|
-
`)}
|
|
13
|
-
}`}function e(q,$,W){let Q=[];if(q.flags&Y.NodeFlags.GlobalAugmentation)return`declare global ${x(q,W)}`;if($)Q.push("export ");Q.push("declare ");let j=q.flags&Y.NodeFlags.Namespace;return Q.push(j?"namespace ":"module "),Q.push(q.name.getText(W)),Q.push(" ",x(q,W)),Q.join("")}function x(q,$){if(!q.body)return"{}";let W=[];function Q(V){if(Y.isFunctionDeclaration(V)){let j=_(V),U=V.name?.getText($)||"",X=[" "];if(j)X.push("export ");if(X.push("function ",U),V.typeParameters){let H=V.typeParameters.map((O)=>O.getText($)).join(", ");X.push("<",H,">")}let Z=V.parameters.map((H)=>{let O=P(H,$),J=H.type?.getText($)||(H.initializer?K(H.initializer.getText($),!1):"unknown"),G=H.questionToken||H.initializer?"?":"";return`${O}${G}: ${J}`}).join(", ");X.push("(",Z,")");let w=V.type?.getText($)||"void";X.push(": ",w,";"),W.push(X.join(""))}else if(Y.isVariableStatement(V)){let j=_(V);for(let U of V.declarationList.declarations)if(U.name&&Y.isIdentifier(U.name)){let X=U.name.getText($),Z=U.type?.getText($),w=U.initializer?.getText($),H=V.declarationList.flags&Y.NodeFlags.Const?"const":V.declarationList.flags&Y.NodeFlags.Let?"let":"var",O=[" "];if(j)O.push("export ");if(O.push(H," ",X),Z)O.push(": ",Z);else if(w){let J=K(w,H==="const");O.push(": ",J)}else O.push(": unknown");O.push(";"),W.push(O.join(""))}}else if(Y.isInterfaceDeclaration(V)){let j=_(V),U=V.name.getText($),X=[" "];if(j)X.push("export ");if(X.push("interface ",U),V.typeParameters){let w=V.typeParameters.map((H)=>H.getText($)).join(", ");X.push("<",w,">")}if(V.heritageClauses){let w=V.heritageClauses.find((H)=>H.token===Y.SyntaxKind.ExtendsKeyword);if(w){let H=w.types.map((O)=>O.getText($)).join(", ");X.push(" extends ",H)}}let Z=r(V,$);X.push(" ",Z),W.push(X.join(""))}else if(Y.isTypeAliasDeclaration(V)){let j=_(V),U=V.name.getText($),X=[" "];if(j)X.push("export ");if(X.push("type ",U),V.typeParameters){let Z=V.typeParameters.map((w)=>w.getText($)).join(", ");X.push("<",Z,">")}X.push(" = ",V.type.getText($)),W.push(X.join(""))}else if(Y.isEnumDeclaration(V)){let j=_(V),U=V.name.getText($),X=V.modifiers?.some((H)=>H.kind===Y.SyntaxKind.ConstKeyword),Z=[" "];if(j)Z.push("export ");if(X)Z.push("const ");Z.push("enum ",U);let w=[];for(let H of V.members)if(Y.isEnumMember(H)){let O=H.name.getText($);if(H.initializer){let J=H.initializer.getText($);w.push(` ${O} = ${J}`)}else w.push(` ${O}`)}Z.push(` {
|
|
14
|
-
`,w.join(`,
|
|
15
|
-
`),`
|
|
16
|
-
}`),W.push(Z.join(""))}else if(Y.isModuleDeclaration(V)){let j=_(V),U=V.name.getText($),X=[" "];if(j)X.push("export ");let Z=V.flags&Y.NodeFlags.Namespace;X.push(Z?"namespace ":"module "),X.push(U," ",x(V,$)),W.push(X.join(""))}else if(Y.isExportAssignment(V)){let j=[" export default "];if(V.expression)j.push(V.expression.getText($));j.push(";"),W.push(j.join(""))}}if(Y.isModuleBlock(q.body))for(let V of q.body.statements)Q(V);else if(Y.isModuleDeclaration(q.body))Q(q.body);return`{
|
|
17
|
-
${W.join(`
|
|
18
|
-
`)}
|
|
19
|
-
}`}function qq(q,$,W){let Q=M(q,$,W),V=!!q.importClause?.isTypeOnly,j=!q.importClause;return{kind:"import",name:"",text:Q,isExported:!1,isTypeOnly:V,isSideEffect:j,source:q.moduleSpecifier.getText(W).slice(1,-1),start:q.getStart(W),end:q.getEnd()}}function Qq(q,$,W,Q=!1){let V=M(q,$,W),j=!!q.isTypeOnly,U=Q?L(q,W):void 0;return{kind:"export",name:"",text:V,isExported:!0,isTypeOnly:j,leadingComments:U,source:q.moduleSpecifier?.getText(W).slice(1,-1),start:q.getStart(W),end:q.getEnd()}}function Wq(q,$,W,Q=!1){let V=M(q,$,W),j=Q?L(q,W):void 0;return{kind:"export",name:"default",text:V,isExported:!0,isTypeOnly:!1,leadingComments:j,start:q.getStart(W),end:q.getEnd()}}function $q(q,$,W,Q){if(!q.name)return null;if(q.body){let G=q.name.getText(W),k=!1;if(R.forEachChild(W,(v)=>{if(R.isFunctionDeclaration(v)&&v!==q&&v.name?.getText(W)===G&&!v.body)k=!0}),k)return null}let V=q.name.getText(W),j=_(q),U=l(q),X=!!q.asteriskToken,Z=t(q,W),w=q.parameters.map((G)=>({name:G.name.getText(W),type:G.type?.getText(W)||"any",optional:!!G.questionToken,defaultValue:G.initializer?.getText(W)})),H=q.type?.getText(W);if(!H)if(U&&X)H="AsyncGenerator<unknown, void, unknown>";else if(X)H="Generator<unknown, void, unknown>";else if(U)H="Promise<void>";else H="void";let O=q.typeParameters?.map((G)=>G.getText(W)).join(", "),J=Q?L(q,W):void 0;return{kind:"function",name:V,text:Z,isExported:j,isAsync:U,isGenerator:X,parameters:w,returnType:H,generics:O?`<${O}>`:void 0,leadingComments:J,start:q.getStart(W),end:q.getEnd()}}function kq(q,$){let W=q.getText($);if(q.kind===R.SyntaxKind.ObjectLiteralExpression)return`typeof ${W} as const`;if(q.kind===R.SyntaxKind.ArrayLiteralExpression)return`readonly ${W}`;if(q.kind===R.SyntaxKind.StringLiteral)return W;if(q.kind===R.SyntaxKind.NumericLiteral)return W;if(q.kind===R.SyntaxKind.TrueKeyword||q.kind===R.SyntaxKind.FalseKeyword)return W;return`typeof ${W}`}function Xq(q,$,W,Q){let V=[];if(!_(q))return V;for(let U of q.declarationList.declarations){if(!U.name||!R.isIdentifier(U.name))continue;let X=U.name.getText(W),Z=U.type?.getText(W),w=U.initializer,H=w?.getText(W),O=q.declarationList.flags&R.NodeFlags.Const?"const":q.declarationList.flags&R.NodeFlags.Let?"let":"var",J=!1;if(w&&R.isAsExpression(w)){if(w.type.getText(W)==="const"){J=!0;let Rq=w.expression;if(!Z)Z=kq(Rq,W)}}let G=a(X,Z,O,!0),k=Q?L(q,W):void 0;V.push({kind:"variable",name:X,text:G,isExported:!0,typeAnnotation:Z,value:H,modifiers:J?[O,"const assertion"]:[O],leadingComments:k,start:q.getStart(W),end:q.getEnd()})}return V}function F(q,$,W,Q){let V=q.name.getText(W),j=_(q),U=n(q,j,W),X=q.heritageClauses?.find((H)=>H.token===R.SyntaxKind.ExtendsKeyword)?.types.map((H)=>H.getText(W)).join(", "),Z=q.typeParameters?.map((H)=>H.getText(W)).join(", "),w=Q?L(q,W):void 0;return{kind:"interface",name:V,text:U,isExported:j,extends:X,generics:Z?`<${Z}>`:void 0,leadingComments:w,start:q.getStart(W),end:q.getEnd()}}function C(q,$,W,Q){let V=q.name.getText(W),j=_(q),U=s(q,j,W),X=q.typeParameters?.map((w)=>w.getText(W)).join(", "),Z=Q?L(q,W):void 0;return{kind:"type",name:V,text:U,isExported:j,generics:X?`<${X}>`:void 0,leadingComments:Z,start:q.getStart(W),end:q.getEnd()}}function y(q,$,W,Q){let V=q.name?.getText(W)||"AnonymousClass",j=_(q),U=o(q,j,W),X=q.heritageClauses?.find((J)=>J.token===R.SyntaxKind.ExtendsKeyword)?.types[0]?.getText(W),Z=q.heritageClauses?.find((J)=>J.token===R.SyntaxKind.ImplementsKeyword)?.types.map((J)=>J.getText(W)),w=q.typeParameters?.map((J)=>J.getText(W)).join(", "),H=q.modifiers?.some((J)=>J.kind===R.SyntaxKind.AbstractKeyword),O=Q?L(q,W):void 0;return{kind:"class",name:V,text:U,isExported:j,extends:X,implements:Z,generics:w?`<${w}>`:void 0,modifiers:H?["abstract"]:void 0,leadingComments:O,start:q.getStart(W),end:q.getEnd()}}function f(q,$,W,Q){let V=q.name.getText(W),j=_(q),U=M(q,$,W),X=q.modifiers?.some((w)=>w.kind===R.SyntaxKind.ConstKeyword),Z=Q?L(q,W):void 0;return{kind:"enum",name:V,text:U,isExported:j,modifiers:X?["const"]:void 0,leadingComments:Z,start:q.getStart(W),end:q.getEnd()}}function Zq(q,$,W,Q){let V=q.name.getText(W),j=_(q),U=e(q,j,W),X=R.isStringLiteral(q.name),Z=Q?L(q,W):void 0;return{kind:"module",name:V,text:U,isExported:j,source:X?V.slice(1,-1):void 0,leadingComments:Z,start:q.getStart(W),end:q.getEnd()}}function Vq(q,$){let W=new Set,Q=new Set,V=new Set;for(let j of q)if(j.kind==="import"){let U=j.text.match(/import\s+(?:type\s+)?\{([^}]+)\}/g);if(U)for(let X of U){let Z=X.replace(/import\s+(?:type\s+)?\{([^}]+)\}/,"$1").split(",");for(let w of Z){let H=w.replace(/^type\s+/,"").trim();Q.add(H)}}}for(let j of q){if(["interface","type","class","enum"].includes(j.kind))V.add(j.name);if(j.kind==="module")i(j.text).forEach((X)=>V.add(X))}for(let j of q)if(j.kind!=="import"&&j.kind!=="export"){let U=j.text.match(/:\s*([A-Z][a-zA-Z0-9]*)/g)||[];for(let X of U){let Z=X.replace(/:\s*/,"");if(!Q.has(Z)&&!V.has(Z)&&!m(Z))W.add(Z)}}return W}function Mq(q,$,W,Q=!0){let V=[];if($.size===0)return V;function j(U){switch(U.kind){case R.SyntaxKind.InterfaceDeclaration:{let X=U,Z=X.name.getText(q);if($.has(Z)){let w=F(X,W,q,Q);V.push(w),$.delete(Z)}break}case R.SyntaxKind.TypeAliasDeclaration:{let X=U,Z=X.name.getText(q);if($.has(Z)){let w=C(X,W,q,Q);V.push(w),$.delete(Z)}break}case R.SyntaxKind.ClassDeclaration:{let X=U;if(X.name){let Z=X.name.getText(q);if($.has(Z)){let w=y(X,W,q,Q);V.push(w),$.delete(Z)}}break}case R.SyntaxKind.EnumDeclaration:{let X=U,Z=X.name.getText(q);if($.has(Z)){let w=f(X,W,q,Q);V.push(w),$.delete(Z)}break}}R.forEachChild(U,j)}return j(q),V}function mq(){jq(),Oq()}function iq(q,$,W=!0,Q=!1){return Jq(q,$,W,Q)}function Eq(q,$,W){let Q=[],V=new Map,j=0;function U(X){if(j!==1){j++,z.forEachChild(X,U),j--;return}switch(X.kind){case z.SyntaxKind.ImportDeclaration:Q.push(qq(X,$,q));break;case z.SyntaxKind.ExportDeclaration:Q.push(Qq(X,$,q,W));break;case z.SyntaxKind.ExportAssignment:Q.push(Wq(X,$,q,W));break;case z.SyntaxKind.FunctionDeclaration:{let Z=$q(X,$,q,W);if(Z&&(Z.isExported||c(Z.name,$)))Q.push(Z);break}case z.SyntaxKind.VariableStatement:{let Z=Xq(X,$,q,W);Q.push(...Z);break}case z.SyntaxKind.InterfaceDeclaration:{let Z=F(X,$,q,W);if(Z.isExported||d(Z.name,$))Q.push(Z);else V.set(Z.name,Z);break}case z.SyntaxKind.TypeAliasDeclaration:{let Z=C(X,$,q,W);if(Q.push(Z),!Z.isExported)V.set(Z.name,Z);break}case z.SyntaxKind.ClassDeclaration:{let Z=y(X,$,q,W);if(Q.push(Z),!Z.isExported&&Z.name)V.set(Z.name,Z);break}case z.SyntaxKind.EnumDeclaration:{let Z=f(X,$,q,W);if(Q.push(Z),!Z.isExported)V.set(Z.name,Z);break}case z.SyntaxKind.ModuleDeclaration:Q.push(Zq(X,$,q,W));break}}if(U(q),V.size>0){let X=Vq(Q,$);for(let Z of X){let w=V.get(Z);if(w)Q.push(w)}}return Q}async function Dq(q,$,W=!0,Q={}){let V=await g($,q,Q);return Eq(V,q,W)}async function tq(q,$={}){let W=$.concurrency??4,Q=new Map;for(let V=0;V<q.length;V+=W){let j=q.slice(V,V+W),U=await Promise.all(j.map(async({filePath:X,sourceCode:Z,keepComments:w})=>{let H=await Dq(Z,X,w,$);return{filePath:X,declarations:H}}));for(let{filePath:X,declarations:Z}of U)Q.set(X,Z)}return Q}export{Bq as wb,g as xb,Lq as yb,Iq as zb,vq as Ab,M as Bb,L as Cb,P as Db,_ as Eb,l as Fb,c as Gb,d as Hb,m as Ib,i as Jb,t as Kb,a as Lb,n as Mb,r as Nb,s as Ob,o as Pb,Hq as Qb,e as Rb,x as Sb,qq as Tb,Qq as Ub,Wq as Vb,$q as Wb,Xq as Xb,F as Yb,C as Zb,y as _b,f as $b,Zq as ac,Vq as bc,Mq as cc,mq as dc,iq as ec,Dq as fc,tq as gc};
|
package/dist/chunk-chbk4344.js
DELETED
package/dist/chunk-ez568rby.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h}from"./chunk-emwe4zbk.js";import"./chunk-b0bkjk0p.js";import"./chunk-94h87sgb.js";import"./chunk-50hbgzrj.js";import"./chunk-2vw7w2j4.js";import"./chunk-sv136qag.js";import"./chunk-57agx6g8.js";import"./chunk-ns3hznyf.js";export{a as parseJSDoc,f as generateTypeDocJSON,c as generateMarkdown,e as generateJSON,d as generateHTML,g as generateDocs,b as extractDocumentation,h as createDocsGenerator};
|
package/dist/chunk-hwm87z68.js
DELETED
package/dist/chunk-jfk0hw36.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ec as u}from"./chunk-b0bkjk0p.js";import{hc as TY}from"./chunk-94h87sgb.js";import{kc as XJ}from"./chunk-50hbgzrj.js";import{Bc as gJ}from"./chunk-pdvve1gm.js";import{Tc as m}from"./chunk-365avtde.js";import{Vc as W,Xc as n}from"./chunk-57agx6g8.js";import{ad as kY,cd as BJ}from"./chunk-ns3hznyf.js";var{Glob:pJ}=globalThis.Bun;import{mkdir as i}from"fs/promises";import{availableParallelism as FY}from"os";import{dirname as g,relative as S,resolve as y}from"path";import{existsSync as YJ,mkdirSync as sJ,readFileSync as aJ,writeFileSync as iJ}from"fs";import{dirname as nJ,relative as oJ,resolve as rJ}from"path";async function KJ(J,Y,$){let X=new Map,Z=[],Q=new Set,U=0,z=0,H=0;for(let q of J){let G=Y.get(q);if(!G)continue;let O=u(G,q,$.keepComments);U+=O.length;for(let V of O)if(V.kind==="import"){z++;let K=V.source||"";if(K.startsWith("."))continue;if(!X.has(K))X.set(K,{source:K,specifiers:new Map,isTypeOnly:V.isTypeOnly||!1,isSideEffect:V.isSideEffect||!1});let B=X.get(K);if(V.specifiers)for(let k of V.specifiers){let T=k.alias||k.name;if(!B.specifiers.has(T))B.specifiers.set(T,{name:k.name,alias:k.alias,isType:k.isType||!1})}if(!V.isTypeOnly)B.isTypeOnly=!1}else if(V.isExported||V.kind==="export"){if(H++,V.name&&Q.has(V.name))continue;if(V.name)Q.add(V.name);Z.push({declaration:V,file:q})}}let j=[];j.push("/**"),j.push(" * Bundled TypeScript declarations"),j.push(` * Generated from ${J.length} source files`),j.push(" */"),j.push("");let _=Array.from(X.values()).sort((q,G)=>{let O=$.importOrder||["bun"],V=O.findIndex((B)=>q.source.startsWith(B)),K=O.findIndex((B)=>G.source.startsWith(B));if(V!==-1&&K!==-1)return V-K;if(V!==-1)return-1;if(K!==-1)return 1;return q.source.localeCompare(G.source)});for(let q of _)if(q.isSideEffect)j.push(`import '${q.source}';`);else if(q.specifiers.size>0){let O=Array.from(q.specifiers.values()).map((K)=>{let B=K.isType?"type ":"";return K.alias?`${B}${K.name} as ${K.alias}`:`${B}${K.name}`}),V=q.isTypeOnly?"type ":"";j.push(`import ${V}{ ${O.join(", ")} } from '${q.source}';`)}if(_.length>0)j.push("");let A=new Map;for(let{declaration:q,file:G}of Z){if(!A.has(G))A.set(G,[]);A.get(G).push(q)}for(let[q,G]of A){let O=oJ($.cwd,q);j.push(`// From: ${O}`);for(let V of G){if($.keepComments&&V.leadingComments)for(let K of V.leadingComments)j.push(K);j.push(OJ(V))}j.push("")}let R=j.join(`
|
|
3
|
-
`);return{content:R,files:J,declarationCount:U,importCount:z,exportCount:H,size:Buffer.byteLength(R,"utf8"),warnings:[]}}function OJ(J){if(J.text){let $=J.text.trim();if(J.isExported&&!$.startsWith("export"))$=`export ${$}`;if(!$.endsWith(";")&&!$.endsWith("}"))$+=";";return $}let Y=[];if(J.isExported)Y.push("export");if(J.isDefault)Y.push("default");switch(J.kind){case"function":if(Y.push("declare function"),Y.push(J.name),J.generics)Y.push(J.generics);if(Y.push(`(${tJ(J.parameters)})`),J.returnType)Y.push(`: ${J.returnType}`);break;case"variable":if(Y.push("declare const"),Y.push(J.name),J.typeAnnotation)Y.push(`: ${J.typeAnnotation}`);break;case"interface":if(Y.push("interface"),Y.push(J.name),J.generics)Y.push(J.generics);if(J.extends)Y.push(`extends ${J.extends}`);if(Y.push("{"),J.members)for(let $ of J.members)Y.push(` ${$.name}${$.typeAnnotation?`: ${$.typeAnnotation}`:""};`);Y.push("}");break;case"type":if(Y.push("type"),Y.push(J.name),J.generics)Y.push(J.generics);Y.push("="),Y.push(J.typeAnnotation||"unknown");break;case"class":if(Y.push("declare class"),Y.push(J.name),J.generics)Y.push(J.generics);if(J.extends)Y.push(`extends ${J.extends}`);if(J.implements&&J.implements.length>0)Y.push(`implements ${J.implements.join(", ")}`);if(Y.push("{"),J.members)for(let $ of J.members)Y.push(` ${OJ($)}`);Y.push("}");break;case"enum":if(Y.push("declare enum"),Y.push(J.name),Y.push("{"),J.members){let $=J.members.map((X)=>X.value!==void 0?`${X.name} = ${X.value}`:X.name);Y.push(` ${$.join(`,
|
|
4
|
-
`)}`)}Y.push("}");break;default:return J.text||""}return Y.join(" ")}function tJ(J){if(!J||J.length===0)return"";return J.map((Y)=>{let $="";if(Y.rest)$+="...";if($+=Y.name,Y.optional)$+="?";if(Y.type)$+=`: ${Y.type}`;if(Y.defaultValue)$+=` = ${Y.defaultValue}`;return $}).join(", ")}async function AJ(J,Y={}){let $=[],X=new Map,Z=[],Q=[],U=new Set,z=0,H=0,j=0;for(let q of J){if(!YJ(q)){$.push(`File not found: ${q}`);continue}let G=aJ(q,"utf-8");Q.push(q);let O=G.split(`
|
|
5
|
-
`),V=[],K=0,B=!1;for(let k of O){let T=k.trim();if(!T&&!B)continue;if(T.startsWith("import ")){H++;let M=T.match(/import\s+(type\s+)?(?:\{([^}]+)\}|(\w+)|\*\s+as\s+(\w+))\s+from\s+['"]([^'"]+)['"]/);if(M){let[,N,L,D,GJ,F]=M;if(Y.externals?.some((o)=>F.startsWith(o))){Z.push(T);continue}if(F.startsWith("."))continue;if(!X.has(F))X.set(F,{source:F,specifiers:new Map,isTypeOnly:!!N,isSideEffect:!1});let HJ=X.get(F);if(L){let o=L.split(",").map((r)=>r.trim());for(let r of o){let[t,e]=r.split(/\s+as\s+/).map((lJ)=>lJ.trim()),WJ=t.startsWith("type "),JJ=WJ?t.replace("type ",""):t;HJ.specifiers.set(e||JJ,{name:JJ,alias:e!==JJ?e:void 0,isType:WJ})}}if(!N)HJ.isTypeOnly=!1}continue}if(/^(export\s+)?(declare\s+)?(interface|type|class|function|const|let|var|enum|namespace|module)\s/.test(T)){if(B=!0,V=[k],K=(k.match(/\{/g)||[]).length-(k.match(/\}/g)||[]).length,K===0&&(T.endsWith(";")||!T.includes("{"))){let M=p(T);if(!U.has(M)||!Y.mergeDuplicates){if(U.add(M),Z.push(k),z++,T.startsWith("export"))j++}B=!1,V=[]}}else if(B){if(V.push(k),K+=(k.match(/\{/g)||[]).length-(k.match(/\}/g)||[]).length,K<=0){let M=V.join(`
|
|
6
|
-
`),N=p(V[0]);if(!U.has(N)||!Y.mergeDuplicates){if(U.add(N),Z.push(M),z++,V[0].trim().startsWith("export"))j++}B=!1,V=[]}}else if(T.startsWith("export ")&&!T.includes("declare"))Z.push(k),j++}}let _=[];if(Y.banner)_.push(Y.banner),_.push("");if(Y.includeReferences&&Y.references){for(let q of Y.references)_.push(`/// <reference types="${q}" />`);_.push("")}let A=Array.from(X.values()).sort((q,G)=>q.source.localeCompare(G.source));for(let q of A)if(q.specifiers.size>0){let O=Array.from(q.specifiers.values()).map((K)=>{let B=K.isType?"type ":"";return K.alias?`${B}${K.name} as ${K.alias}`:`${B}${K.name}`}),V=q.isTypeOnly?"type ":"";_.push(`import ${V}{ ${O.join(", ")} } from '${q.source}';`)}if(A.length>0)_.push("");if(Y.ambient&&Y.moduleName){_.push(`declare module '${Y.moduleName}' {`);for(let q of Z){let G=q.split(`
|
|
7
|
-
`).map((O)=>` ${O.replace(/^(\s*)(export\s+)?declare\s+/,"$1$2")}`).join(`
|
|
8
|
-
`);_.push(G)}_.push("}")}else{if(Y.sortDeclarations)Z.sort((q,G)=>{let O=p(q),V=p(G);return O.localeCompare(V)});for(let q of Z)_.push(q)}if(Y.footer)_.push(""),_.push(Y.footer);let R=_.join(`
|
|
9
|
-
`);return{content:R,files:Q,declarationCount:z,importCount:H,exportCount:j,size:Buffer.byteLength(R,"utf-8"),warnings:$}}function p(J){let Y=J.match(/(interface|type|class|function|const|let|var|enum|namespace|module)\s+(\w+)/);return Y?`${Y[1]}:${Y[2]}`:J.trim()}async function eJ(J,Y,$={}){let X=await AJ(J,$),Z=nJ(Y);if(!YJ(Z))sJ(Z,{recursive:!0});return iJ(Y,X.content),X}function CY(J={}){return{bundle:(Y)=>AJ(Y,J),bundleAndWrite:(Y,$)=>eJ(Y,$,{...J,output:$})}}async function PY(J,Y=process.cwd()){let $=Array.isArray(J)?J:[J],X=[];for(let Z of $){if(Z.includes("*"))continue;let Q=rJ(Y,Z);if(YJ(Q))X.push(Q)}return X}import{existsSync as c,mkdirSync as JY,readFileSync as ZJ,statSync as RJ,writeFileSync as kJ}from"fs";import{join as TJ,relative as d,resolve as YY}from"path";var $J=1,qJ=".dtsx-cache",$Y="manifest.json";class QJ{cacheDir;manifestPath;manifest=null;configHash;constructor(J){this.cacheDir=YY(J.cwd,qJ),this.manifestPath=TJ(this.cacheDir,$Y),this.configHash=this.hashConfig(J)}hashConfig(J){let Y={keepComments:J.keepComments,importOrder:J.importOrder,outputStructure:J.outputStructure};return String(XJ(JSON.stringify(Y)))}hashString(J){return String(XJ(J))}load(){try{if(!c(this.manifestPath))return!1;let J=ZJ(this.manifestPath,"utf-8"),Y=JSON.parse(J);if(Y.version!==$J)return!1;if(Y.configHash!==this.configHash)return!1;return this.manifest=Y,!0}catch{return!1}}save(){if(!this.manifest)this.manifest={version:$J,configHash:this.configHash,entries:{},createdAt:Date.now(),updatedAt:Date.now()};if(this.manifest.updatedAt=Date.now(),!c(this.cacheDir))JY(this.cacheDir,{recursive:!0});kJ(this.manifestPath,JSON.stringify(this.manifest,null,2))}needsRegeneration(J,Y){return this.getCachedIfValid(J,Y)===null}getCached(J,Y){return this.getCachedIfValid(J,Y)}getCachedIfValid(J,Y){if(!this.manifest)return null;let $=d(Y,J),X=this.manifest.entries[$];if(!X)return null;try{let Q=RJ(J).mtimeMs;if(Q>X.sourceMtime){let U=ZJ(J,"utf-8");if(this.hashString(U)!==X.sourceHash)return null;X.sourceMtime=Q}return X.dtsContent}catch{return null}}update(J,Y,$,X){if(!this.manifest)this.manifest={version:$J,configHash:this.configHash,entries:{},createdAt:Date.now(),updatedAt:Date.now()};let Z=d(X,J),Q;try{Q=RJ(J).mtimeMs}catch{Q=Date.now()}this.manifest.entries[Z]={sourcePath:Z,sourceHash:this.hashString(Y),sourceMtime:Q,dtsContent:$,dtsHash:this.hashString($),generatedAt:Date.now(),configHash:this.configHash}}remove(J,Y){if(!this.manifest)return;let $=d(Y,J);delete this.manifest.entries[$]}clear(){this.manifest=null;try{if(c(this.manifestPath))BJ("fs").rmSync(this.cacheDir,{recursive:!0,force:!0})}catch{}}getStats(){if(!this.manifest)return{entries:0,size:0};let J=Object.keys(this.manifest.entries).length,Y=0;for(let $ of Object.values(this.manifest.entries))Y+=$.dtsContent.length;return{entries:J,size:Y}}prune(J,Y){if(!this.manifest)return 0;let $=0,X=new Set(Array.from(J).map((Z)=>d(Y,Z)));for(let Z of Object.keys(this.manifest.entries))if(!X.has(Z))delete this.manifest.entries[Z],$++;return $}}function NJ(J){let Y=TJ(J,".gitignore");try{let $="";if(c(Y))$=ZJ(Y,"utf-8");if(!$.includes(qJ)){let X=`${$.trimEnd()}
|
|
10
|
-
|
|
11
|
-
# dtsx cache
|
|
12
|
-
${qJ}/
|
|
13
|
-
`;kJ(Y,X)}}catch{}}import{spawn as XY}from"child_process";import{readFile as LJ,stat as ZY,writeFile as qY}from"fs/promises";var v=typeof globalThis.Bun<"u",cY=!v&&typeof process<"u"&&!!process.versions?.node,lY=v?"bun":"node";class MJ{name;_size=-1;constructor(J){this.name=J}async exists(){try{return await ZY(this.name),!0}catch{return!1}}async text(){return LJ(this.name,"utf-8")}async arrayBuffer(){let J=await LJ(this.name);return J.buffer.slice(J.byteOffset,J.byteOffset+J.byteLength)}get size(){if(this._size===-1)return-1;return this._size}}class SJ{pid;stdout;stderr;stdin;exited;process;constructor(J){this.process=J,this.pid=J.pid??0,this.stdout=J.stdout,this.stderr=J.stderr,this.stdin=J.stdin,this.exited=new Promise((Y)=>{J.on("exit",($)=>{Y($??0)}),J.on("error",()=>{Y(1)})})}kill(J){this.process.kill(J)}ref(){this.process.ref()}unref(){this.process.unref()}}function l(J){if(v)return globalThis.Bun.file(J);return new MJ(J)}async function UJ(J,Y){if(v)return globalThis.Bun.write(J,Y);let $=typeof Y==="string"?Y:Y instanceof ArrayBuffer?Buffer.from(Y):Y;return await qY(J,$),typeof Y==="string"?Buffer.byteLength(Y):Y.byteLength}function wJ(J,Y={}){if(v)return globalThis.Bun.spawn(J,Y);let $=Array.isArray(J)?J:[J],[X,...Z]=$,Q={cwd:Y.cwd,env:Y.env,stdio:[Y.stdin??"pipe",Y.stdout??"pipe",Y.stderr??"pipe"]},U=XY(X,Z,Q);return new SJ(U)}async function I(J){return l(J).text()}async function sY(J){return l(J).exists()}async function aY(J,Y){await UJ(J,Y)}function iY(){if(v)return{name:"bun",version:globalThis.Bun.version,isBun:!0,isNode:!1};return{name:"node",version:process.versions.node,isBun:!1,isNode:!0}}var P={PARSE_ERROR:"PARSE_ERROR",SYNTAX_ERROR:"SYNTAX_ERROR",FILE_NOT_FOUND:"FILE_NOT_FOUND",FILE_READ_ERROR:"FILE_READ_ERROR",FILE_WRITE_ERROR:"FILE_WRITE_ERROR",TYPE_INFERENCE_ERROR:"TYPE_INFERENCE_ERROR",UNRESOLVED_TYPE:"UNRESOLVED_TYPE",EXTRACTION_ERROR:"EXTRACTION_ERROR",PROCESSING_ERROR:"PROCESSING_ERROR",VALIDATION_ERROR:"VALIDATION_ERROR",INVALID_DECLARATION:"INVALID_DECLARATION",CONFIG_ERROR:"CONFIG_ERROR",INVALID_ENTRYPOINT:"INVALID_ENTRYPOINT",CIRCULAR_DEPENDENCY:"CIRCULAR_DEPENDENCY",TIMEOUT_ERROR:"TIMEOUT_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",UNKNOWN_ERROR:"UNKNOWN_ERROR"};class w extends Error{code;context;constructor(J,Y="UNKNOWN_ERROR",$){super(J);if(this.name="DtsxError",this.code=Y,this.context=$,Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(){let J=`${this.name} [${this.code}]: ${this.message}`;if(this.context)J+=`
|
|
14
|
-
Context: ${JSON.stringify(this.context,null,2)}`;return J}toJSON(){return{name:this.name,code:this.code,message:this.message,context:this.context,stack:this.stack}}}class FJ extends w{filePath;line;column;constructor(J,Y,$){super(J,"PARSE_ERROR",{filePath:Y,line:$?.line,column:$?.column});if(this.name="ParseError",this.filePath=Y,this.line=$?.line,this.column=$?.column,$?.cause)this.cause=$.cause}get locationString(){if(this.line!==void 0&&this.column!==void 0)return`${this.filePath}:${this.line}:${this.column}`;return this.line!==void 0?`${this.filePath}:${this.line}`:this.filePath}}class QY extends w{filePath;declarationKind;constructor(J,Y,$,X){super(J,"EXTRACTION_ERROR",{filePath:Y,declarationKind:$});if(this.name="ExtractionError",this.filePath=Y,this.declarationKind=$,X)this.cause=X}}class UY extends w{declarationName;constructor(J,Y,$){super(J,"PROCESSING_ERROR",{declarationName:Y});if(this.name="ProcessingError",this.declarationName=Y,$)this.cause=$}}class vJ extends w{filePath;operation;constructor(J,Y,$,X){super(J,$==="read"?"FILE_READ_ERROR":"FILE_WRITE_ERROR",{filePath:Y,operation:$});if(this.name="FileError",this.filePath=Y,this.operation=$,X)this.cause=X}}class EJ extends w{configPath;invalidKey;constructor(J,Y){super(J,"CONFIG_ERROR",{configPath:Y?.configPath,invalidKey:Y?.invalidKey});if(this.name="ConfigError",this.configPath=Y?.configPath,this.invalidKey=Y?.invalidKey,Y?.cause)this.cause=Y.cause}}class jY extends w{cycle;constructor(J){super(`Circular dependency detected: ${J.join(" -> ")}`,"CIRCULAR_DEPENDENCY",{cycle:J});this.name="CircularDependencyError",this.cycle=J}}function oY(J){return J instanceof w}function rY(J){return J instanceof FJ}function tY(J){return J instanceof vJ}function eY(J){return J instanceof EJ}function J0(J,Y="UNKNOWN_ERROR",$){if(J instanceof w)return J;let X=$||(J instanceof Error?J.message:String(J)),Z=new w(X,Y);if(J instanceof Error)Z.cause=J;return Z}function Y0(J,Y){let $=1,X=1,Z=0;for(let Q of J){if(Z>=Y)break;if(Q===`
|
|
15
|
-
`)$++,X=1;else X++;Z++}return{line:$,column:X,offset:Y}}function $0(J,Y,$,X){let Z=J.split(`
|
|
16
|
-
`),Q=Y.line-1,U=[];if(X)U.push(`${X}:${Y.line}:${Y.column}`);else U.push(`Line ${Y.line}, Column ${Y.column}`);U.push(`Error: ${$}`),U.push("");let z=Math.max(0,Q-1),H=Math.min(Z.length-1,Q+1);for(let j=z;j<=H;j++){let _=(j+1).toString().padStart(4," "),A=j===Q?">":" ";if(U.push(`${A} ${_} | ${Z[j]}`),j===Q){let R=" ".repeat(8+Y.column-1);U.push(`${R}^`)}}return U.join(`
|
|
17
|
-
`)}function jJ(J,Y,$){let X={file:Y,message:"Unknown error",code:P.UNKNOWN_ERROR};if(J instanceof Error){X.message=J.message,X.stack=J.stack;let Z=J.message.match(/\((\d+),(\d+)\)/);if(Z)X.location={line:Number.parseInt(Z[1],10),column:Number.parseInt(Z[2],10)};if(J.message.includes("Cannot find")||J.message.includes("not found"))X.code=P.FILE_NOT_FOUND,X.suggestion="Check that the file path is correct and the file exists.";else if(J.message.includes("syntax")||J.message.includes("Unexpected token"))X.code=P.SYNTAX_ERROR,X.suggestion="Check for syntax errors in your TypeScript code.";else if(J.message.includes("type")&&J.message.includes("cannot"))X.code=P.TYPE_INFERENCE_ERROR,X.suggestion="Add explicit type annotations to help with type inference.";else if(J.message.includes("parse")||J.message.includes("Parse"))X.code=P.PARSE_ERROR,X.suggestion="The file contains invalid TypeScript syntax."}else if(typeof J==="string")X.message=J;return X}function yJ(J,Y){let $=[],X=J.file;if(J.location)X+=`:${J.location.line}:${J.location.column}`;if(J.code)X+=` [${J.code}]`;if($.push(X),$.push(` Error: ${J.message}`),Y&&J.location){$.push("");let Z=Y.split(`
|
|
18
|
-
`),Q=J.location.line-1;if(Q>=0&&Q<Z.length){let U=Math.max(0,Q-1),z=Math.min(Z.length-1,Q+1);for(let H=U;H<=z;H++){let j=(H+1).toString().padStart(4," "),_=H===Q?">":" ";if($.push(` ${_} ${j} | ${Z[H]}`),H===Q&&J.location.column>0){let A=" ".repeat(10+J.location.column-1);$.push(` ${A}^`)}}}}if(J.suggestion)$.push(""),$.push(` Suggestion: ${J.suggestion}`);return $.join(`
|
|
19
|
-
`)}function X0(J){if(J.length===0)return"No errors";let Y=new Map;for(let X of J){let Z=X.code||"UNKNOWN";Y.set(Z,(Y.get(Z)||0)+1)}let $=[`${J.length} error(s) found:`];for(let[X,Z]of Y.entries())$.push(` - ${X}: ${Z}`);return $.join(`
|
|
20
|
-
`)}var s=null,E=null;async function VY(){if(s!==null)return s;try{return E=await import("prettier"),s=!0,!0}catch{return s=!1,!1}}async function zY(J,Y){if(!E)return null;try{if(Y&&E.resolveConfig){let $=await E.resolveConfig(Y);if($)return $}if(J&&E.resolveConfig){let $=await E.resolveConfig(J);if($)return $}return null}catch{return null}}async function _Y(J,Y){if(!E)throw Error("Prettier is not available");let $={...Y,parser:Y.parser||"typescript"};return E.format(J,$)}function GY(J,Y={}){let{indentSize:$=2,useTabs:X=!1,maxLineWidth:Z=100,trailingNewline:Q=!0,normalizeWhitespace:U=!0,sortImports:z=!0,groupImports:H=!0}=Y,j=J,_=X?"\t":" ".repeat($);if(j=j.replace(/\r\n/g,`
|
|
21
|
-
`),U)j=j.replace(/[ \t]+$/gm,""),j=j.replace(/\n{3,}/g,`
|
|
22
|
-
|
|
23
|
-
`),j=HY(j,_);if(z||H)j=WY(j,{sort:z,group:H});if(Z>0)j=OY(j,Z,_);if(Q&&!j.endsWith(`
|
|
24
|
-
`))j+=`
|
|
25
|
-
`;return j}function HY(J,Y){let $=J.split(`
|
|
26
|
-
`),X=[];for(let Z of $){let Q=Z.match(/^(\s*)(.*)$/);if(!Q){X.push(Z);continue}let[,U,z]=Q;if(!z){X.push("");continue}let H=U.replace(/\t/g," ").length,j=Math.floor(H/2);X.push(Y.repeat(j)+z)}return X.join(`
|
|
27
|
-
`)}function WY(J,Y){let $=J.split(`
|
|
28
|
-
`),X=[],Z=[],Q=!1,U=0;for(let H=0;H<$.length;H++){let j=$[H],_=j.match(/^(import\s+(?:type\s+)?.*from\s+['"])([^'"]+)(['"].*)$/);if(_)Q=!0,U=H,X.push({line:j,source:_[2],isType:j.includes("import type")});else if(Q&&j.trim()==="")continue;else{if(Q)Q=!1;Z.push(j)}}if(X.length===0)return J;if(Y.sort)X.sort((H,j)=>{if(H.isType!==j.isType)return H.isType?1:-1;return KY(H.source,j.source)});let z;if(Y.group){let H=X.filter((q)=>q.source.startsWith("node:")),j=X.filter((q)=>!q.source.startsWith(".")&&!q.source.startsWith("node:")&&!q.source.includes("/")),_=X.filter((q)=>!q.source.startsWith(".")&&!q.source.startsWith("node:")&&q.source.includes("/")&&!q.source.startsWith("@")),A=X.filter((q)=>q.source.startsWith("@")),R=X.filter((q)=>q.source.startsWith("."));z=[...H.map((q)=>q.line),...H.length>0&&j.length>0?[""]:[],...j.map((q)=>q.line),...(H.length>0||j.length>0)&&_.length>0?[""]:[],..._.map((q)=>q.line),...A.length>0&&(H.length>0||j.length>0||_.length>0)?[""]:[],...A.map((q)=>q.line),...R.length>0?[""]:[],...R.map((q)=>q.line)]}else z=X.map((H)=>H.line);return[...z,"",...Z].join(`
|
|
29
|
-
`)}function KY(J,Y){let $=J.startsWith("node:"),X=Y.startsWith("node:");if($!==X)return $?-1:1;let Z=J.startsWith("."),Q=Y.startsWith(".");if(Z!==Q)return Z?1:-1;return J.localeCompare(Y)}function OY(J,Y,$){let X=J.split(`
|
|
30
|
-
`),Z=[];for(let Q of X){if(Q.length<=Y){Z.push(Q);continue}if(Q.trimStart().startsWith("import ")){Z.push(Q);continue}let U=Q.match(/^(\s*)/)?.[1]||"",z=U+$;if(Q.includes("{")&&Q.includes("}")){let H=AY(Q,Y,U,z);Z.push(...H);continue}if(Q.includes(" | ")){let H=RY(Q,Y,U,z);Z.push(...H);continue}Z.push(Q)}return Z.join(`
|
|
31
|
-
`)}function AY(J,Y,$,X){let Z=J.match(/^(\s*)(.*?)(\{)(.+)(\}.*)$/);if(!Z)return[J];let[,,Q,U,z,H]=Z,j=z.split(/;\s*|,\s*/).filter((A)=>A.trim());if(j.length<=1)return[J];return[`${$}${Q}${U}`,...j.map((A)=>`${X}${A.trim()};`),`${$}${H.trim()}`]}function RY(J,Y,$,X){let Z=J.match(/^(\s*)(.*?=\s*)(.+)$/);if(!Z)return[J];let[,,Q,U]=Z,z=U.split(/\s*\|\s*/).filter((j)=>j.trim());if(z.length<=2)return[J];return[`${$}${Q}`,...z.map((j,_)=>`${X}${_>0?"| ":" "}${j.trim()}`)]}async function h(J,Y={},$){let X=[];if(Y.usePrettier!==!1){if(await VY())try{let z={...await zY(Y.prettierConfigPath,$),...Y.prettierOptions,parser:"typescript"};return{content:await _Y(J,z),usedPrettier:!0}}catch(U){X.push(`Prettier formatting failed: ${U}. Using built-in formatter.`)}else if(Y.usePrettier===!0)X.push("Prettier requested but not available. Using built-in formatter.")}return{content:GY(J,Y.builtIn),usedPrettier:!1,warnings:X.length>0?X:void 0}}async function BY(J,Y={}){let $=new Map;for(let[X,Z]of J){let Q=await h(Z,Y,X);$.set(X,Q)}return $}function q0(J={}){return{format:(Y,$)=>h(Y,J,$),formatMany:(Y)=>BY(Y,J)}}async function Q0(J){return(await h(J,{usePrettier:!0,builtIn:{indentSize:2,normalizeWhitespace:!0,sortImports:!0,trailingNewline:!0}})).content}class a{plugins=[];config=null;register(J){if(this.plugins.some((Y)=>Y.name===J.name))throw Error(`Plugin "${J.name}" is already registered`);this.plugins.push(J)}unregister(J){let Y=this.plugins.findIndex(($)=>$.name===J);if(Y>=0)return this.plugins.splice(Y,1),!0;return!1}getPlugins(){return this.plugins}createLogger(J){return{debug:(Y)=>console.debug(`[${J}] ${Y}`),info:(Y)=>console.info(`[${J}] ${Y}`),warn:(Y)=>console.warn(`[${J}] ${Y}`),error:(Y)=>console.error(`[${J}] ${Y}`)}}async runOnStart(J){let Y=J;for(let $ of this.plugins)if($.onStart){let X=await $.onStart(Y);if(X)Y=X}return this.config=Y,Y}async runOnBeforeFile(J,Y){let $=Y;for(let X of this.plugins)if(X.onBeforeFile){let Z={filePath:J,sourceCode:Y,content:$,config:this.config,log:this.createLogger(X.name)},Q=await X.onBeforeFile(Z);if(typeof Q==="string")$=Q}return $}async runOnDeclarations(J,Y,$){let X=$;for(let Z of this.plugins)if(Z.onDeclarations){let Q={filePath:J,sourceCode:Y,declarations:X,config:this.config,log:this.createLogger(Z.name)},U=await Z.onDeclarations(Q);if(U)X=U}return X}async runOnAfterFile(J,Y,$){let X=$;for(let Z of this.plugins)if(Z.onAfterFile){let Q={filePath:J,sourceCode:Y,content:X,config:this.config,log:this.createLogger(Z.name)},U=await Z.onAfterFile(Q);if(typeof U==="string")X=U}return X}async runOnEnd(J){for(let Y of this.plugins)if(Y.onEnd)await Y.onEnd(J)}async runOnError(J,Y,$){for(let X of this.plugins)if(X.onError){let Z={filePath:Y,sourceCode:$,config:this.config,log:this.createLogger(X.name)};await X.onError(J,Z)}}}var j0=new a;function VJ(J){return J}var V0=VJ({name:"strip-internal",version:"1.0.0",description:"Removes declarations marked with @internal",onDeclarations:(J)=>{return J.declarations.filter((Y)=>{if(Y.leadingComments){if(Y.leadingComments.some((X)=>X.includes("@internal")))return J.log.debug(`Stripping internal declaration: ${Y.name}`),!1}return!0})}});function z0(J){return VJ({name:"banner",version:"1.0.0",description:"Adds a banner comment to generated files",onAfterFile:(Y)=>{return`/**
|
|
32
|
-
* ${J.split(`
|
|
33
|
-
`).join(`
|
|
34
|
-
* `)}
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
`+Y.content}})}function _0(J){return VJ({name:"filter",version:"1.0.0",description:"Filters declarations by name",onDeclarations:(Y)=>{return Y.declarations.filter(($)=>{if($.kind==="import")return!0;return J($.name)})}})}var b=kY(TY(),1);import{readdir as NY}from"fs/promises";import{dirname as LY,extname as MY,isAbsolute as SY,join as bJ,resolve as DJ}from"path";import xJ from"process";import{pathToFileURL as zJ}from"url";function B0(J,Y){throw Error(Y||`Unexpected value: ${J}`)}async function x(J,Y){let $=Y.replace(/\r\n/g,`
|
|
38
|
-
`);if(!$.endsWith(`
|
|
39
|
-
`))$+=`
|
|
40
|
-
`;await UJ(J,$)}async function wY(J){let Y=J??m.root,$=await NY(Y,{withFileTypes:!0}),X=await Promise.all($.map((Z)=>{let Q=bJ(Y,Z.name);return Z.isDirectory()?wY(Q):Q}));return Array.prototype.concat(...X).filter((Z)=>MY(Z)===".ts")}async function CJ(J){try{let Y=J?.cwd||xJ.cwd(),$=J?.tsconfigPath||bJ(Y,"tsconfig.json"),Z=await import(zJ($).href);if(Z.compilerOptions?.isolatedDeclarations===!0)return!0;if(Z.extends){let Q=IJ($,Z.extends),U=Q.endsWith(".json")?Q:`${Q}.json`,H=await import(zJ(U).href);if(H.compilerOptions?.isolatedDeclarations===!0)return!0;if(H.extends){let j=IJ(U,H.extends),_=j.endsWith(".json")?j:`${j}.json`;if((await import(zJ(_).href)).compilerOptions?.isolatedDeclarations===!0)return!0}}return!1}catch{return!1}}function PJ(J,Y){let $={isValid:!0,errors:[]},X=b.default.createSourceFile(Y,J,b.default.ScriptTarget.Latest,!0,b.default.ScriptKind.TS),Z={getSourceFile:(z)=>{if(z===Y)return X;return},getDefaultLibFileName:()=>"lib.d.ts",writeFile:()=>{},getCurrentDirectory:()=>"",getCanonicalFileName:(z)=>z,useCaseSensitiveFileNames:()=>!0,getNewLine:()=>`
|
|
41
|
-
`,fileExists:(z)=>z===Y,readFile:()=>{return}},U=[...b.default.createProgram({rootNames:[Y],options:{noEmit:!0,declaration:!0,skipLibCheck:!0,noLib:!0},host:Z}).getSyntacticDiagnostics(X)];for(let z of U){let H=b.default.flattenDiagnosticMessageText(z.messageText,`
|
|
42
|
-
`),j=`TS${z.code}`,_;switch(z.code){case 1005:_="Add a semicolon at the end of the statement.";break;case 1109:_="Check for missing or malformed expressions.";break;case 1128:_="Ensure proper declaration syntax is used.";break;case 2304:_="Import or declare the missing type/value.";break;case 2307:_="Check that the module exists and is installed.";break;case 2322:_="Check type compatibility between the values.";break;case 2339:_="Add the missing property to the type definition.";break;case 2345:_="Check the argument types match the expected parameters.";break}if(z.file&&z.start!==void 0){let{line:A,character:R}=z.file.getLineAndCharacterOfPosition(z.start);$.errors.push({line:A+1,column:R+1,message:H,code:j,suggestion:_})}else $.errors.push({line:0,column:0,message:H,code:j,suggestion:_})}return $.isValid=$.errors.length===0,$}function hJ(J,Y,$){let X=J.split(`
|
|
43
|
-
`),Z=Y.split(`
|
|
44
|
-
`),Q=new Set(X),U=new Set(Z),z=X.filter((_)=>!U.has(_)),H=Z.filter((_)=>!Q.has(_));if(z.length===0&&H.length===0)return"";let j=[];j.push(`--- ${$}`),j.push(`+++ ${$}`);for(let _ of z)j.push(`- ${_}`);for(let _ of H)j.push(`+ ${_}`);return j.join(`
|
|
45
|
-
`)}function IJ(J,Y){if(SY(Y))return Y;if(Y.startsWith("."))return DJ(LY(J),Y);return DJ(xJ.cwd(),"node_modules",Y)}function mJ(J,Y,$,X){let Z=J.split(`
|
|
46
|
-
`),Q=[];function U(_){let R="",q=_<0?-_<<1|1:_<<1;do{let G=q&31;if(q>>>=5,q>0)G|=32;R+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[G]}while(q>0);return R}let z=0,H=0,j=0;for(let _=0;_<Z.length;_++){if(Z[_].trim()===""){Q.push("");continue}z=0;let R=Math.min(_,X.split(`
|
|
47
|
-
`).length-1),q=[],G=0-z,O=0,V=R-H,K=0-j;q.push(U(G)+U(O)+U(V)+U(K)),z=0,H=R,j=0,Q.push(q.join(","))}return{version:3,file:Y,sourceRoot:"",sources:[$],sourcesContent:[X],mappings:Q.join(";")}}function fJ(J,Y){return`${J}
|
|
48
|
-
//# sourceMappingURL=${Y}
|
|
49
|
-
`}async function vY(J){let Y=Date.now(),$={...m,...J};if($.logLevel)n($.logLevel);else if($.verbose)n("debug");let X=new a;if($.plugins&&$.plugins.length>0){for(let q of $.plugins)X.register(q),W.debug(`Registered plugin: ${q.name}`);$=await X.runOnStart($)}if($.isolatedDeclarations===void 0)$.isolatedDeclarations=await CJ($);let Z=null;if($.incremental){if(Z=new QJ($),$.clearCache)W.debug("Clearing build cache..."),Z.clear();else if(Z.load()){let G=Z.getStats();W.debug(`Loaded build cache with ${G.entries} entries`)}else W.debug("No existing build cache found, starting fresh");NJ($.cwd)}let Q={filesProcessed:0,filesGenerated:0,filesFailed:0,filesValidated:0,validationErrors:0,declarationsFound:0,importsProcessed:0,exportsProcessed:0,durationMs:0,errors:[]},U=0;W.debug("Starting DTS generation..."),W.debug("Config:",$);let z=await DY($);if(Z){let q=Z.prune(new Set(z),$.cwd);if(q>0)W.debug(`Pruned ${q} deleted files from cache`)}if(W.debug(`Found ${z.length} TypeScript files`),$.progress&&z.length>0){let q=$.parallel?"parallel":"sequential";W.info(`Processing ${z.length} files (${q})...`)}let H=async(q,G)=>{let O;try{let V=uJ(q,$);if(Z){let M=Z.getCachedIfValid(q,$.cwd);if(M)return await i(g(V),{recursive:!0}),await x(V,M),W.debug(`[cached] ${S($.cwd,V)}`),{success:!0,file:q,declarationCount:0,importCount:0,exportCount:0,cached:!0,validationErrorCount:0}}O=G??await I(q);let{content:K,declarationCount:B,importCount:k,exportCount:T}=await cJ(q,O,$,X),C=0;if($.dryRun)W.info(`[dry-run] Would generate: ${V}`),W.debug("--- Content preview ---"),W.debug(K.slice(0,500)+(K.length>500?`
|
|
50
|
-
...`:"")),W.debug("--- End preview ---");else{if($.diff)try{let N=await I(V),L=hJ(N,K,S($.cwd,V));if(L)W.info(`
|
|
51
|
-
${L}`);else W.debug(`[no changes] ${V}`)}catch{W.info(`[new file] ${S($.cwd,V)}`)}await i(g(V),{recursive:!0});let M=K;if($.declarationMap&&O){let N=V.split("/").pop()||"output.d.ts",L=S(g(V),q),D=`${N}.map`,GJ=mJ(K,N,L,O),F=`${V}.map`;await x(F,JSON.stringify(GJ)),M=fJ(K,D),W.debug(` Generated source map: ${S($.cwd,F)}`)}if($.prettier||$.indentStyle||$.indentSize){let N=await h(M,{usePrettier:$.prettier,builtIn:{indentSize:$.indentSize||2,useTabs:$.indentStyle==="tabs",normalizeWhitespace:!0,sortImports:!0,trailingNewline:!0}},V);if(M=N.content,N.warnings?.length)for(let L of N.warnings)W.warn(`[format] ${L}`)}if(await x(V,M),Z&&O)Z.update(q,O,M,$.cwd);if($.validate){let N=PJ(K,V);if(!N.isValid){C=N.errors.length,W.warn(`[validation] ${S($.cwd,V)} has ${N.errors.length} error(s):`);for(let L of N.errors){let D=` Line ${L.line}:${L.column}`;if(L.code)D+=` [${L.code}]`;if(D+=` - ${L.message}`,W.warn(D),L.suggestion)W.warn(` Suggestion: ${L.suggestion}`)}}else W.debug(`[validation] ${V} - OK`)}W.debug(`Generated: ${V}`)}return{success:!0,file:q,declarationCount:B,importCount:k,exportCount:T,validationErrorCount:C}}catch(V){let K=jJ(V,q,O);if($.plugins&&$.plugins.length>0)await X.runOnError(V instanceof Error?V:Error(String(V)),q,O||"");return{success:!1,file:q,declarationCount:0,importCount:0,exportCount:0,dtsError:K,validationErrorCount:0}}},j=$.parallel||$.parallel!==!1&&z.length>=10,_=$.concurrency||(FY?.()??8),A=new Map;if(j&&z.length>1){let q=z.map(async(G)=>{try{let O=await I(G);return{file:G,source:O}}catch{return{file:G,source:null}}});for(let G of await Promise.all(q))if(G.source!==null)A.set(G.file,G.source)}let R=(q)=>{if(Q.filesProcessed++,q.success){if(q.cached)U++;else Q.filesGenerated++,Q.declarationsFound+=q.declarationCount,Q.importsProcessed+=q.importCount,Q.exportsProcessed+=q.exportCount;if($.validate){if(Q.filesValidated++,q.validationErrorCount)Q.validationErrors+=q.validationErrorCount}}else if(Q.filesFailed++,q.dtsError){Q.errors.push(q.dtsError);let G=yJ(q.dtsError);if($.continueOnError)W.warn(G);else throw W.error(G),Error(q.dtsError.message)}};if(j)for(let q=0;q<z.length;q+=_){let G=z.slice(q,q+_),O=await Promise.all(G.map((V)=>H(V,A.get(V))));for(let V of O)R(V);if($.progress){let V=Math.round(Q.filesProcessed/z.length*100);W.info(`[${Q.filesProcessed}/${z.length}] ${V}%`)}}else for(let q of z){let G=await H(q);if(R(G),$.progress){let O=Math.round(Q.filesProcessed/z.length*100),V=G.cached?"[cached]":"";W.info(`[${Q.filesProcessed}/${z.length}] ${O}% - ${S($.cwd,q)} ${V}`)}}if(Z)Z.save(),W.debug("Saved build cache");if($.bundle&&(Q.filesGenerated>0||U>0))try{W.debug("Bundling declarations...");let q=new Map;for(let K of z){let B=await I(K);q.set(K,B)}let G=await KJ(z,q,$),O=$.bundleOutput||"index.d.ts",V=y($.cwd,$.outdir,O);await i(g(V),{recursive:!0}),await x(V,G.content),W.info(`Bundled ${G.files.length} files to: ${S($.cwd,V)}`)}catch(q){let G=q instanceof Error?q.message:String(q);W.error(`Bundle failed: ${G}`)}if(Q.durationMs=Date.now()-Y,$.stats)if($.outputFormat==="json")console.log(JSON.stringify(Q,null,2));else{if(W.info(`
|
|
52
|
-
--- Generation Statistics ---`),W.info(`Files processed: ${Q.filesProcessed}`),W.info(`Files generated: ${Q.filesGenerated}`),U>0)W.info(`Files cached: ${U}`);if(Q.filesFailed>0)W.info(`Files failed: ${Q.filesFailed}`);if(W.info(`Declarations found: ${Q.declarationsFound}`),W.info(`Imports processed: ${Q.importsProcessed}`),W.info(`Exports processed: ${Q.exportsProcessed}`),Q.filesValidated>0){if(W.info(`Files validated: ${Q.filesValidated}`),Q.validationErrors>0)W.info(`Validation errors: ${Q.validationErrors}`)}if(W.info(`Duration: ${Q.durationMs}ms`),Q.errors.length>0){W.info(`
|
|
53
|
-
Errors:`);for(let q of Q.errors){let G=` - ${q.file}`;if(q.location)G+=`:${q.location.line}:${q.location.column}`;if(q.code)G+=` [${q.code}]`;if(G+=`: ${q.message}`,W.info(G),q.suggestion)W.info(` Suggestion: ${q.suggestion}`)}}W.info(`-----------------------------
|
|
54
|
-
`)}if($.plugins&&$.plugins.length>0)await X.runOnEnd(Q);return W.debug("DTS generation complete!"),Q}var EY=50,f=new Map;function yY(J){let Y=f.get(J);if(!Y){if(Y=new pJ(J),f.set(J,Y),f.size>EY){let $=f.keys().next().value;if($!==void 0)f.delete($)}}return Y}function _J(J,Y,$){if(!Y||Y.length===0)return!1;let X=S($,J);for(let Z of Y){let Q=yY(Z);if(Q.match(X)||Q.match(J))return!0}return!1}async function DY(J){let Y=[],$=y(J.cwd,J.root),X=J.exclude||[];for(let Z of J.entrypoints)if(Z.startsWith("/")&&Z.endsWith(".ts")){if(!Z.endsWith(".d.ts")&&!Z.includes("node_modules")){if(!_J(Z,X,$))Y.push(Z)}}else{let Q=new pJ(Z);for await(let U of Q.scan({cwd:$,absolute:!0,onlyFiles:!0}))if(!U.endsWith(".d.ts")&&!U.includes("node_modules")){if(!_J(U,X,$))Y.push(U)}}return[...new Set(Y)]}function uJ(J,Y){let $=y(Y.cwd,Y.root),Z=S($,J).replace(/\.(m?tsx?|cts)$/,(Q)=>{if(Q===".mts")return".d.mts";if(Q===".cts")return".d.cts";return".d.ts"});if(Y.outputStructure==="mirror")return y(Y.cwd,Y.outdir,Z);else{let Q=Z.split("/").pop();return y(Y.cwd,Y.outdir,Q)}}async function h0(J,Y){return(await dJ(J,Y)).content}async function dJ(J,Y,$){let X=await I(J);return cJ(J,X,Y,$)}async function cJ(J,Y,$,X){let Z=Y;if(X)Z=await X.runOnBeforeFile(J,Y);let Q=u(Z,J,$.keepComments,$.isolatedDeclarations??!1);if(X)Q=await X.runOnDeclarations(J,Z,Q);let U=0,z=0;for(let _=0;_<Q.length;_++){let A=Q[_];if(A.kind==="import")U++;if(A.kind==="export"||A.isExported)z++}let j=gJ(Q,{filePath:J,sourceCode:Z,declarations:Q},$.keepComments,$.importOrder);if(X)j=await X.runOnAfterFile(J,Z,j);return{content:j,declarationCount:Q.length,importCount:U,exportCount:z}}async function m0(J){let Y={...m,...J};if(Y.logLevel)n(Y.logLevel);let $=y(Y.cwd,Y.root),X=150,Z=5,Q=1e4,U={pendingChanges:new Set,debounceTimer:null,isProcessing:!1,errorCount:0,lastErrorTime:0};W.info(`Watching for changes in ${$}...`),W.info(`Press Ctrl+C to stop
|
|
55
|
-
`);try{await vY(Y),W.info(`[watch] Initial generation complete
|
|
56
|
-
`)}catch(A){let R=A instanceof Error?A.message:String(A);W.error(`[watch] Initial generation failed: ${R}`),W.info(`[watch] Continuing to watch for changes...
|
|
57
|
-
`)}async function z(){if(U.isProcessing||U.pendingChanges.size===0)return;let A=Date.now();if(U.errorCount>=Z){if(A-U.lastErrorTime<Q){W.warn(`[watch] Too many errors, pausing for ${Math.ceil((Q-(A-U.lastErrorTime))/1000)}s...`);return}U.errorCount=0}U.isProcessing=!0;let R=Array.from(U.pendingChanges);U.pendingChanges.clear();let q=new Date().toLocaleTimeString();if(R.length===1)W.info(`
|
|
58
|
-
[${q}] File changed: ${R[0]}`);else W.info(`
|
|
59
|
-
[${q}] ${R.length} files changed`);let G=0,O=0;for(let V of R){let K=y($,V);try{let B=Y.exclude||[];if(_J(K,B,$)){W.debug(` Skipping excluded file: ${V}`);continue}if(!await l(K).exists()){W.debug(` Skipping deleted file: ${V}`);continue}let T=uJ(K,Y),{content:C}=await dJ(K,Y);await i(g(T),{recursive:!0}),await x(T,C),W.info(` \u2713 ${S(Y.cwd,T)}`),G++}catch(B){O++,U.errorCount++,U.lastErrorTime=Date.now();let k=jJ(B,K);if(W.error(` \u2717 ${V}: ${k.message}`),k.suggestion)W.error(` Suggestion: ${k.suggestion}`)}}if(R.length>1)W.info(` Done: ${G} generated, ${O} failed`);if(O===0)U.errorCount=0;if(U.isProcessing=!1,U.pendingChanges.size>0)U.debounceTimer=setTimeout(z,X)}function H(A){if(U.pendingChanges.add(A),U.debounceTimer)clearTimeout(U.debounceTimer);U.debounceTimer=setTimeout(z,X)}let _=wJ([v?"bun":"node","-e",`
|
|
60
|
-
const fs = require('fs');
|
|
61
|
-
|
|
62
|
-
const rootPath = '${$}';
|
|
63
|
-
|
|
64
|
-
fs.watch(rootPath, { recursive: true }, (eventType, filename) => {
|
|
65
|
-
if (filename && filename.endsWith('.ts') && !filename.endsWith('.d.ts')) {
|
|
66
|
-
console.log('CHANGED:' + filename);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
// Keep process alive
|
|
71
|
-
setInterval(() => {}, 1000);
|
|
72
|
-
`],{stdout:"pipe",stderr:"inherit"});if(v){let A=_.stdout.getReader(),R=new TextDecoder,q="";while(!0){let{done:G,value:O}=await A.read();if(G)break;q+=R.decode(O,{stream:!0});let V=q.split(`
|
|
73
|
-
`);q=V.pop()||"";for(let K of V)if(K.startsWith("CHANGED:")){let B=K.slice(8);H(B)}}}else{let A=_.stdout,R="";A.on("data",(q)=>{R+=q.toString();let G=R.split(`
|
|
74
|
-
`);R=G.pop()||"";for(let O of G)if(O.startsWith("CHANGED:")){let V=O.slice(8);H(V)}}),await _.exited}}
|
|
75
|
-
export{KJ as ua,AJ as va,eJ as wa,CY as xa,PY as ya,QJ as za,NJ as Aa,v as Ba,cY as Ca,lY as Da,l as Ea,UJ as Fa,wJ as Ga,I as Ha,sY as Ia,aY as Ja,iY as Ka,P as La,w as Ma,FJ as Na,QY as Oa,UY as Pa,vJ as Qa,EJ as Ra,jY as Sa,oY as Ta,rY as Ua,tY as Va,eY as Wa,J0 as Xa,Y0 as Ya,$0 as Za,jJ as _a,yJ as $a,X0 as ab,h as bb,BY as cb,q0 as db,Q0 as eb,a as fb,j0 as gb,VJ as hb,V0 as ib,z0 as jb,_0 as kb,B0 as lb,x as mb,wY as nb,CJ as ob,PJ as pb,hJ as qb,mJ as rb,fJ as sb,vY as tb,h0 as ub,m0 as vb};
|
package/dist/chunk-myvmq7hz.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{l as a,m as b,n as c,o as d,p as e,q as f,r as g}from"./chunk-nfeqwqca.js";import"./chunk-jfk0hw36.js";import"./chunk-b0bkjk0p.js";import"./chunk-94h87sgb.js";import"./chunk-6jpqpjkc.js";import"./chunk-50hbgzrj.js";import"./chunk-2vw7w2j4.js";import"./chunk-pdvve1gm.js";import"./chunk-sv136qag.js";import"./chunk-365avtde.js";import"./chunk-57agx6g8.js";import"./chunk-ns3hznyf.js";export{b as sortProjectsByDependencies,f as resolveWorkspacePatterns,c as generateWorkspace,d as generateMonorepo,g as generateFromPackageWorkspaces,a as discoverWorkspaceProjects,e as discoverWorkspaceFromPackageJson};
|
package/dist/chunk-nd0xbpbz.js
DELETED
package/dist/chunk-nfeqwqca.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{tb as y}from"./chunk-jfk0hw36.js";import{Vc as H,Xc as F}from"./chunk-57agx6g8.js";import{cd as R}from"./chunk-ns3hznyf.js";import{existsSync as V,readFileSync as G}from"fs";import{dirname as M,join as X,resolve as x}from"path";async function S(E){let A=[],z=new Set;async function q(I,L){let w=x(I);if(z.has(w))return;if(z.add(w),!V(w)){H.warn(`tsconfig not found: ${w}`);return}try{let O=G(w,"utf-8").replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),K=JSON.parse(O),U=M(w),Y=B(U,L),W=[];if(K.references)for(let D of K.references){let $=x(U,D.path),J=V(X($,"tsconfig.json"))?X($,"tsconfig.json"):$;await q(J,Y);let b=B(M(J),Y);W.push(b)}let Z="./src";if(K.compilerOptions?.rootDir)Z=K.compilerOptions.rootDir;else if(K.include&&K.include.length>0){if(K.include[0].startsWith("src/"))Z="./src"}let _="./dist";if(K.compilerOptions?.outDir)_=K.compilerOptions.outDir;else if(K.compilerOptions?.declarationDir)_=K.compilerOptions.declarationDir;A.push({name:Y,root:U,tsconfigPath:w,references:W,config:{root:Z,outdir:_}})}catch(Q){let O=Q instanceof Error?Q.message:String(Q);H.warn(`Failed to parse ${w}: ${O}`)}}return await q(E),A}function B(E,A){let z=X(E,"package.json");if(V(z))try{let I=G(z,"utf-8"),L=JSON.parse(I);if(L.name)return L.name}catch{}let q=E.split("/").pop()||"unknown";return A?`${A}/${q}`:q}function N(E){let A=new Map(E.map((w)=>[w.name,w])),z=[],q=new Set,I=new Set;function L(w){if(q.has(w))return;if(I.has(w)){H.warn(`Circular dependency detected involving: ${w}`);return}I.add(w);let Q=A.get(w);if(Q){for(let O of Q.references)L(O);z.push(Q)}I.delete(w),q.add(w)}for(let w of E)L(w.name);return z}async function T(E){let A=Date.now(),z=N(E.projects);H.info(`Generating declarations for ${z.length} projects...`);let q=[],I=!0;for(let O of z){H.info(`
|
|
3
|
-
[${O.name}] Generating...`);try{let K={...E.sharedConfig,...O.config,cwd:O.root,tsconfigPath:O.tsconfigPath},U=await y(K),Y=U.filesFailed===0;if(!Y)I=!1;q.push({name:O.name,stats:U,success:Y}),H.info(`[${O.name}] Generated ${U.filesGenerated} files`)}catch(K){I=!1;let U=K instanceof Error?K.message:String(K);q.push({name:O.name,stats:{filesProcessed:0,filesGenerated:0,filesFailed:0,filesValidated:0,validationErrors:0,declarationsFound:0,importsProcessed:0,exportsProcessed:0,durationMs:0,errors:[]},success:!1,error:U}),H.error(`[${O.name}] Failed: ${U}`)}}let L=Date.now()-A,w=q.filter((O)=>O.success).length,Q=q.length-w;if(H.info(`
|
|
4
|
-
--- Workspace Generation Summary ---`),H.info(`Projects processed: ${q.length}`),H.info(`Successful: ${w}`),Q>0)H.info(`Failed: ${Q}`);return H.info(`Total duration: ${L}ms`),H.info(`------------------------------------
|
|
5
|
-
`),{success:I,projects:q,durationMs:L}}async function f(E,A){if(A?.logLevel)F(A.logLevel);let z=X(E,"tsconfig.json");if(!V(z))throw Error(`Root tsconfig.json not found at: ${z}`);H.info("Discovering workspace projects...");let q=await S(z);if(q.length===0)return H.warn("No projects found in workspace"),{success:!0,projects:[],durationMs:0};return H.info(`Found ${q.length} projects`),T({root:E,projects:q,sharedConfig:A})}async function v(E){let A=X(E,"package.json");if(!V(A))return[];try{let z=G(A,"utf-8"),q=JSON.parse(z),I=[];if(Array.isArray(q.workspaces))I=q.workspaces;else if(q.workspaces?.packages)I=q.workspaces.packages;return I}catch{return[]}}async function C(E,A){let{Glob:z}=awaitPromise.resolve(globalThis.Bun),q=[];for(let I of A){let L=new z(I);for await(let w of L.scan({cwd:E,absolute:!0,onlyFiles:!1})){let Q=X(w,"package.json");if(V(Q))q.push(w)}}return q}async function l(E,A){if(A?.logLevel)F(A.logLevel);let z=await v(E);if(z.length===0)return H.warn("No workspace patterns found in package.json"),{success:!0,projects:[],durationMs:0};H.info(`Found workspace patterns: ${z.join(", ")}`);let q=await C(E,z);if(q.length===0)return H.warn("No projects found matching workspace patterns"),{success:!0,projects:[],durationMs:0};H.info(`Found ${q.length} workspace packages`);let I=q.map((L)=>{let w=X(L,"tsconfig.json");return{name:B(L),root:L,tsconfigPath:V(w)?w:"",references:[]}});return T({root:E,projects:I,sharedConfig:A})}
|
|
6
|
-
export{S as l,N as m,T as n,f as o,v as p,C as q,l as r};
|
package/dist/chunk-nr1gxnen.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./chunk-ns3hznyf.js";var e="@stacksjs/dtsx",i="module",n="0.9.13",r=!0,c="A modern, fast .d.ts generation tool, powered by Bun.",o="Chris Breuer <chris@stacksjs.org>",u="MIT",d="https://github.com/stacksjs/dtsx#readme",p={type:"git",url:"git+https://github.com/stacksjs/dtsx.git"},a={url:"https://github.com/stacksjs/dtsx/issues"},b=["dts","generation","isolated declarations","development","bun","stacks","typescript","javascript"],g={".":{import:"./dist/index.js"},"./*":{import:"./dist/*"}},l="./dist/index.js",m="./dist/index.d.ts",k={dtsx:"./dist/cli.js"},x=["dist"],h={benchmark:"bun benchmark/index.ts",build:"bun --filter './packages/dtsx' build",test:"bun test",lint:"bunx --bun pickier run . --mode lint --config .config/pickier.ts","lint:fix":"bunx --bun pickier run . --mode lint --fix --config .config/pickier.ts",changelog:"bunx logsmith --verbose","changelog:generate":"bunx logsmith --output CHANGELOG.md",release:"bun --bun run changelog:generate && bunx --bun bumpx prompt --recursive",typecheck:"bunx tsc --noEmit","dev:docs":"bun --bun vitepress dev docs","build:docs":"bun --bun vitepress build docs","preview:docs":"bun --bun vitepress preview docs"},v={"@stacksjs/bumpx":"^0.2.4","@stacksjs/bunpress":"^0.1.1","@stacksjs/clapp":"^0.2.0",pickier:"^0.1.18","@stacksjs/gitlint":"^0.1.5","@stacksjs/logsmith":"^0.2.1","@types/bun":"^1.3.9","@typescript/native-preview":"^7.0.0-dev.20260216.1","buddy-bot":"^0.9.16","bun-git-hooks":"^0.3.1","bun-plugin-dtsx":"workspace:*",mitata:"^1.0.34","oxc-transform":"^0.112.0",typescript:"^5.9.3"},j=["packages/*"],y={name:e,type:i,version:n,private:r,description:c,author:o,license:u,homepage:d,repository:p,bugs:a,keywords:b,exports:g,module:l,types:m,bin:k,files:x,scripts:h,devDependencies:v,workspaces:j};export{j as workspaces,n as version,m as types,i as type,h as scripts,p as repository,r as private,e as name,l as module,u as license,b as keywords,d as homepage,x as files,g as exports,v as devDependencies,c as description,y as default,a as bugs,k as bin,o as author};
|
package/dist/chunk-pdvve1gm.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Cc as Kz,Dc as Uz,Ec as P,Lc as u,Mc as p,Nc as jz}from"./chunk-sv136qag.js";function _(z,X=!0){if(!X||!z||z.length===0)return"";if(z.length===1)return z[0].trim()+`
|
|
3
|
-
`;let K="";for(let Z=0;Z<z.length;Z++){if(Z>0)K+=`
|
|
4
|
-
`;K+=z[Z].trim()}return`${K}
|
|
5
|
-
`}function Jz(z){if(z.includes(`
|
|
6
|
-
`))return`/**
|
|
7
|
-
* ${z}
|
|
8
|
-
*/
|
|
9
|
-
`;return`/** ${z} */
|
|
10
|
-
`}function Xz(z){let X=z.indexOf("{");if(X===-1)return-1;let K=z.indexOf("<");if(K===-1||K>X)return X;let Z=0,H=!1,j="";for(let Y=0;Y<z.length;Y++){let J=z[Y],G=Y>0?z[Y-1]:"";if(!H&&(J==='"'||J==="'"||J==="`"))H=!0,j=J;else if(H&&J===j&&G!=="\\")H=!1;if(!H){if(J==="<")Z++;else if(J===">")Z--;else if(J==="{"&&Z===0)return Y}}return-1}function n(z,X=!0){return _(z.leadingComments,X)+z.text}function c(z,X=!0){let K=_(z.leadingComments,X);if(z.typeAnnotation&&!z.value)return K+z.text;let Z="";if(z.isExported)Z+="export ";Z+="declare ";let H=z.modifiers?.[0]||"const";Z+=`${H} `,Z+=z.name;let{typeAnnotation:j,value:Y}=z;if(Y&&Y.includes(" satisfies ")){let G=p(Y);if(G)j=G}else if(Y&&Y.trim().endsWith("as const"))j=P(Y,!0);else if(!j&&Y&&H==="const"){let G=Y.trim(),W=G.startsWith("{")||G.startsWith("[");if(W)Kz();j=P(Y,!W)}else if(j&&Y&&H==="const"&&u(j)){let G=P(Y,!0);if(G!=="unknown")j=G}else if(!j&&Y)j=P(Y,H==="const");if(!j)j="unknown";let J="";if(Y&&!z.typeAnnotation&&!Y.trim().endsWith("as const")){let G=Y.trim();if(H!=="const"){if((j==="string"||j==="number"||j==="boolean")&&G.length>0)J=`@defaultValue ${G}`}else if(G.startsWith("{")||G.startsWith("[")){let W=Uz();if(W)if(W.includes(`
|
|
11
|
-
`))J=`@defaultValue
|
|
12
|
-
* \`\`\`ts
|
|
13
|
-
${W.split(`
|
|
14
|
-
`).map((R)=>` * ${R}`).join(`
|
|
15
|
-
`)}
|
|
16
|
-
* \`\`\``;else J=`@defaultValue \`${W}\``}}if(Z+=`: ${j};`,J&&K&&K.includes("@defaultValue"))J="";if(J&&K){let G=K.trimEnd(),W=G.lastIndexOf("*/");if(W!==-1){let R=G.slice(0,W).trimEnd();if(R.startsWith("/** ")&&!R.includes(`
|
|
17
|
-
`))R=`/**
|
|
18
|
-
* ${R.slice(4)}`;return`${R}
|
|
19
|
-
* ${J}
|
|
20
|
-
*/
|
|
21
|
-
`+Z}return`/**
|
|
22
|
-
* ${G.replace(/^\/\/\s*/,"")}
|
|
23
|
-
* ${J}
|
|
24
|
-
*/
|
|
25
|
-
${Z}`}if(J)return`${Jz(J)}${Z}`;return K+Z}function d(z,X=!0){let K=_(z.leadingComments,X),Z=z.text;if(Z.startsWith("export declare interface")||Z.startsWith("declare interface"))return K+Z;let H="";if(z.isExported)H+="export ";if(H+="declare interface ",H+=z.name,z.generics)H+=z.generics;if(z.extends)H+=` extends ${z.extends}`;let j=Xz(z.text);if(j!==-1)H+=` ${z.text.slice(j)}`;else H+=" {}";return K+H}function l(z,X=!0){let K=_(z.leadingComments,X);if(z.text.includes("{")&&z.text.includes("}")&&z.text.includes("from"))return K+z.text;let Z="";if(z.isExported)Z+="export ";if(!z.isExported&&!z.text.includes(" from "))Z+="declare ";let H=z.text.indexOf("type ");if(H!==-1){let Y=z.text.slice(H),J=Y.length;while(J>0&&(Y.charCodeAt(J-1)===59||Y.charCodeAt(J-1)===32||Y.charCodeAt(J-1)===10||Y.charCodeAt(J-1)===13))J--;if(J<Y.length)Y=Y.slice(0,J);Z+=Y}else{if(Z+=`type ${z.name}`,z.generics)Z+=z.generics;Z+=" = any"}let j=Z.trimEnd();if(!j.endsWith(";")&&!j.endsWith("}"))Z+=";";return K+Z}function i(z,X=!0){return _(z.leadingComments,X)+z.text}function o(z,X=!0){let K=_(z.leadingComments,X),Z="";if(z.isExported)Z+="export ";if(Z+="declare ",z.modifiers?.includes("const"))Z+="const ";Z+="enum ",Z+=z.name;let H=z.text.indexOf("{");if(H!==-1)Z+=` ${z.text.slice(H)}`;else Z+=" {}";return K+Z}function Lz(z){let X=z.text.trim(),K=X.length;while(K>0&&X.charCodeAt(K-1)===59)K--;if(K<X.length)X=X.slice(0,K);return X+=";",X}function Gz(z,X=!0){return _(z.leadingComments,X)+z.text.trim()}function s(z,X=!0){let K=_(z.leadingComments,X);if(z.text.startsWith("declare global"))return K+z.text;if(z.source||(z.name.startsWith('"')||z.name.startsWith("'")||z.name.startsWith("`"))){let Y="declare module ";Y+=z.name;let J=z.text.indexOf("{");if(J!==-1)Y+=` ${z.text.slice(J)}`;else Y+=" {}";return K+Y}let H="";if(z.isExported)H+="export ";if(!z.modifiers?.includes("declare"))H+="declare ";H+="namespace ",H+=z.name;let j=z.text.indexOf("{");if(j!==-1)H+=` ${z.text.slice(j)}`;else H+=" {}";return K+H}var Rz=new Map,T=new Map;function Yz(z){return T.get(z)??null}function m(z,X){if(T.set(z,X),T.size>200){let K=0;for(let Z of T.keys()){if(K++>=20)break;T.delete(Z)}}}function Wz(){Rz.clear(),T.clear()}function a(z){let X=z.indexOf(" from ");if(X===-1)return null;let K=z.slice(X+6).trim(),Z=K[0];if(Z!=='"'&&Z!=="'")return null;let H=K.indexOf(Z,1);if(H===-1)return null;let j=K.slice(1,H),Y=z.slice(0,X).trim(),J=Y.startsWith("import type ");if(Y.startsWith("import "))Y=Y.slice(7).trim();if(Y.startsWith("type "))Y=Y.slice(5).trim();let G=null,W=[],Q=Y.indexOf("{"),R=Y.lastIndexOf("}");if(Q!==-1&&R!==-1){let D=Y.slice(0,Q).trim();if(D.endsWith(","))G=D.slice(0,-1).trim()||null;let w=Y.slice(Q+1,R),b=0;for(let S=0;S<=w.length;S++)if(S===w.length||w.charCodeAt(S)===44){let F=b,O=S;while(F<O&&(w.charCodeAt(F)===32||w.charCodeAt(F)===9||w.charCodeAt(F)===10))F++;while(O>F&&(w.charCodeAt(O-1)===32||w.charCodeAt(O-1)===9||w.charCodeAt(O-1)===10))O--;if(F<O)W.push(w.slice(F,O));b=S+1}}else G=Y.trim()||null;return{defaultName:G,namedItems:W,source:j,isTypeOnly:J}}function r(z){let X=Yz(z);if(X)return X;let K=[],Z=z.indexOf(" from ");if(Z===-1)return m(z,K),K;let H=z.slice(0,Z).trim();if(H.startsWith("import "))H=H.slice(7).trim();if(H.startsWith("type "))H=H.slice(5).trim();let j=H.indexOf("{"),Y=H.lastIndexOf("}");if(j!==-1&&Y!==-1){let J=H.slice(0,j).trim();if(J.endsWith(",")){let Q=J.slice(0,-1).trim();if(Q)K.push(Q)}else if(J&&!J.includes(","))K.push(J);let W=H.slice(j+1,Y).split(",");for(let Q=0;Q<W.length;Q++){let R=W[Q].trim();if(!R)continue;if(R.startsWith("type "))R=R.slice(5).trim();let D=R.indexOf(" as ");if(D!==-1)R=R.slice(D+4).trim();if(R)K.push(R)}}else{let J=H.trim();if(J)K.push(J)}return m(z,K),K}function Zz(z,X){throw Error(X||`Unexpected value: ${z}`)}function Vz(z){return z>=65&&z<=90||z>=97&&z<=122||z>=48&&z<=57||z===95||z===36||z>127}function $z(z){let X=new Set,K=0,Z=z.length;while(K<Z){let H=z.charCodeAt(K);if(H>=65&&H<=90||H>=97&&H<=122||H===95||H===36||H>127){let j=K;K++;while(K<Z&&Vz(z.charCodeAt(K)))K++;X.add(z.substring(j,K))}else K++}return X}var Qz=/export\s+(?:type\s+)?\{\s*([^}]+)\s*\}/;function Tz(z,X,K=!0,Z=["bun"]){let H="",j=X.sourceCode;if(j){let U=0;while(U<j.length&&(j.charCodeAt(U)===32||j.charCodeAt(U)===9||j.charCodeAt(U)===10||j.charCodeAt(U)===13))U++;if(U<j.length-2&&j.charCodeAt(U)===47&&j.charCodeAt(U+1)===47&&j.charCodeAt(U+2)===47){let L=jz(j);if(L.length>0)for(let V=0;V<L.length;V++){if(H)H+=`
|
|
26
|
-
`;H+=L[V]}}}let Y=[],J=[],G=[],W=[],Q=[],R=[],D=[],w=[],b=[];for(let U of z){let L=U.kind;switch(L){case"import":Y.push(U);break;case"function":J.push(U);break;case"variable":G.push(U);break;case"interface":W.push(U);break;case"type":Q.push(U);break;case"class":R.push(U);break;case"enum":D.push(U);break;case"module":w.push(U);break;case"export":b.push(U);break;case"namespace":w.push(U);break;case"unknown":break;default:Zz(L,`Unhandled declaration kind: ${L}`)}}let S=new Set,F=[],O=[],x=[],t=new Set;for(let U of b){let L=_(U.leadingComments,K);if(U.text.startsWith("export default")){let V=U.text.endsWith(";")?U.text:`${U.text};`;x.push(L+V)}else{let V=U.text.trim();if(!V.endsWith(";"))V+=";";let M=V.match(Qz);if(M){let q=M[1].split(",").map((B)=>B.trim());for(let B of q)S.add(B)}let $=L+V;if(!t.has($))if(t.add($),$.includes("export type"))F.push($);else O.push($)}}let y=new Map;if(Y.length>0)for(let U of Y){let L=r(U.text);for(let V of L)y.set(V,U)}let e=new Set;if(W.length>0){let U=[];for(let L of J)if(L.isExported)U.push(L.text);for(let L of R)U.push(L.text);for(let L of Q)U.push(L.text);if(U.length>0){let L=$z(U.join(`
|
|
27
|
-
`));for(let V of W)if(L.has(V.name))e.add(V.name)}}let N=[];if(Y.length>0){let U=new Set,L=[];for(let $ of J)if($.isExported)L.push($.text);for(let $ of G)if($.isExported){if(L.push($.text),$.typeAnnotation)L.push($.typeAnnotation)}for(let $ of W)if($.isExported||e.has($.name))L.push($.text);for(let $ of Q)L.push($.text);for(let $ of R)L.push($.text);for(let $ of D)L.push($.text);for(let $ of w)L.push($.text);for(let $ of b)L.push($.text);let V=L.join(`
|
|
28
|
-
`);if(V&&y.size>0){let $=$z(V);for(let q of y.keys())if($.has(q))U.add(q)}for(let $ of S)if(y.has($))U.add($);for(let $ of Y){if($.isSideEffect){let E=$.text.trim(),g=E.endsWith(";")?E:`${E};`;N.push(g);continue}let q=a($.text);if(!q)continue;let{defaultName:B,namedItems:A,source:v,isTypeOnly:k}=q,h=B?U.has(B):!1,I="",C=0;for(let E=0;E<A.length;E++){let g=A[E],f=g.charCodeAt(0)===116&&g.startsWith("type ")?g.slice(5).trim():g.trim(),Hz=f.indexOf(" as ");if(Hz!==-1)f=f.slice(Hz+4).trim();if(U.has(f)){if(C>0)I+=", ";I+=g,C++}}if(h||C>0){let E=k?"import type ":"import ";if(h&&B)E+=C>0?`${B}, { ${I} }`:B;else if(C>0)E+=`{ ${I} }`;E+=` from '${v}';`,N.push(E)}}let M=Z.length;if(N.length>1){let $=Z.map((A)=>`from '${A}`),q=Z.map((A)=>`from "${A}`),B=new Map;for(let A of N){let v=M;for(let k=0;k<Z.length;k++)if(A.includes($[k])||A.includes(q[k])){v=k;break}B.set(A,v)}N.sort((A,v)=>{let k=B.get(A),h=B.get(v);return k!==h?k-h:A.localeCompare(v)})}}for(let U=0;U<N.length;U++){if(H)H+=`
|
|
29
|
-
`;H+=N[U]}for(let U=0;U<F.length;U++){if(H)H+=`
|
|
30
|
-
`;H+=F[U]}let zz=[J,G,W,Q,R,D,w];for(let U=0;U<zz.length;U++){let L=zz[U];for(let V=0;V<L.length;V++){let M=L[V],$="",q=M.kind;switch(q){case"function":$=n(M,K);break;case"variable":$=c(M,K);break;case"interface":$=d(M,K);break;case"type":$=l(M,K);break;case"class":$=i(M,K);break;case"enum":$=o(M,K);break;case"module":case"namespace":$=s(M,K);break;case"import":case"export":case"unknown":break;default:Zz(q,`Unhandled declaration kind in processor: ${q}`)}if($){if(H)H+=`
|
|
31
|
-
`;H+=$}}}for(let U=0;U<O.length;U++){if(H)H+=`
|
|
32
|
-
`;H+=O[U]}for(let U=0;U<x.length;U++){if(H)H+=`
|
|
33
|
-
`;H+=x[U]}return H}export{_ as oc,n as pc,c as qc,d as rc,l as sc,i as tc,o as uc,Lz as vc,Gz as wc,s as xc,Wz as yc,a as zc,r as Ac,Tz as Bc};
|
package/dist/chunk-sv136qag.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var k=!1,M=null;function p(J){let Y="",X=0;while(X<J.length)if(J.charCodeAt(X)===47&&X+1<J.length&&J.charCodeAt(X+1)===42){X+=2;while(X<J.length-1){if(J.charCodeAt(X)===42&&J.charCodeAt(X+1)===47){X+=2;break}X++}}else Y+=J.charAt(X),X++;return Y.trim()}function t(){k=!0,M=null}function e(){k=!1;let J=M;return M=null,J}function g(J){let Y=J.length;if(Y===0)return!1;let X=0;if(J.charCodeAt(X)===45)X++;if(X>=Y)return!1;let $=X;while(X<Y&&J.charCodeAt(X)>=48&&J.charCodeAt(X)<=57)X++;if(X===$)return!1;if(X<Y&&J.charCodeAt(X)===46){X++;let z=X;while(X<Y&&J.charCodeAt(X)>=48&&J.charCodeAt(X)<=57)X++;if(X===z)return!1}return X===Y}function l(J){for(let Y=0,X=J.length-1;Y<X;Y++){let $=J.charCodeAt(Y);if($<48||$>57)return!1}return!0}function E(J,Y){let X=0,$=0;while(($=J.indexOf(Y,$))!==-1)X++,$+=Y.length;return X}function P(J){let Y=J.length,X=!1;for(let Z=1;Z<Y;Z++)if(J.charCodeAt(Z)<=32&&J.charCodeAt(Z-1)<=32){X=!0;break}if(!X)for(let Z=0;Z<Y;Z++){let H=J.charCodeAt(Z);if(H===10||H===13||H===9){X=!0;break}}if(!X)return J;let $=[],z=-1,B=!1;for(let Z=0;Z<Y;Z++)if(J.charCodeAt(Z)<=32){if(!B){if(z>=0)$.push(J.substring(z,Z));$.push(" "),B=!0,z=-1}}else{if(B||z<0)z=Z;B=!1}if(z>=0)$.push(J.substring(z));return $.join("")}function V(J,Y=!1,X=!1,$=0){if(!J||typeof J!=="string")return"unknown";if($>=20)return"unknown";let z=J.trim();if(z.startsWith("BigInt("))return"bigint";if(z.startsWith("Symbol.for("))return"symbol";if(z.includes(".raw`")||z.includes("String.raw`"))return"string";if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'")||z.startsWith("`")&&z.endsWith("`")){if(!z.includes("${")){if(!Y)return"string";return z}if(Y)return z;return"string"}if(g(z)){if(!Y)return"number";return z}if(z==="true"||z==="false"){if(!Y)return"boolean";return z}if(z==="null")return"null";if(z==="undefined")return"undefined";if(z.startsWith("[")&&z.endsWith("]"))return D(z,Y,$+1);if(z.startsWith("{")&&z.endsWith("}"))return i(z,Y,$+1);if(z.startsWith("new "))return d(z);if(z.includes("=>")||z.startsWith("function")||z.startsWith("async"))return h(z,X,$,Y);if(z.endsWith("as const")){let B=z.slice(0,-8).trim();if(B.startsWith("[")&&B.endsWith("]")){let Z=B.slice(1,-1).trim();if(!Z)return"readonly []";return`readonly [${U(Z).map((j)=>V(j.trim(),!0,!1,$+1)).join(", ")}]`}return V(B,!0,X,$+1)}if(z.startsWith("`")&&z.endsWith("`"))return c(z,Y);if(z.startsWith("Promise."))return y(z,Y,$);if(z.startsWith("await "))return"unknown";if(z.charCodeAt(z.length-1)===110&&z.length>1&&l(z)){if(Y)return z;return"bigint"}if(z.startsWith("Symbol(")||z==="Symbol.for")return"symbol";return"unknown"}function m(J,Y=!1,X=0){return V(J,Y,!0,X)}function c(J,Y){if(J.includes(".raw`")||J.includes("String.raw`"))return"string";if(!Y)return"string";if(!J.includes("${"))return J;return"string"}function d(J){let Y=4;while(Y<J.length&&J.charCodeAt(Y)<=32)Y++;let X=Y,$=J.charCodeAt(Y);if($<65||$>90)return"unknown";while(Y<J.length&&T(J.charCodeAt(Y)))Y++;if(Y===X)return"unknown";let z=J.slice(X,Y);{let B=J.slice(Y);if(B.startsWith("<")){let Z=0,H=-1;for(let G=0;G<B.length;G++)if(B[G]==="<")Z++;else if(B[G]===">"){if(Z--,Z===0){H=G;break}}if(H!==-1){let G=B.slice(0,H+1);return`${z}${G}`}}switch(z){case"Date":return"Date";case"Map":return"Map<any, any>";case"Set":return"Set<any>";case"WeakMap":return"WeakMap<any, any>";case"WeakSet":return"WeakSet<any>";case"RegExp":return"RegExp";case"Error":return"Error";case"Array":return"any[]";case"Object":return"object";case"Function":return"Function";case"Promise":return"Promise<any>";default:return z}}return"unknown"}function y(J,Y,X=0){if(J.startsWith("Promise.resolve(")){let z=J.indexOf(")",16);if(z!==-1){let B=J.slice(16,z).trim();if(B)return`Promise<${V(B,Y,!1,X+1)}>`}return"Promise<unknown>"}if(J.startsWith("Promise.reject("))return"Promise<never>";if(J.startsWith("Promise.all(")){let $=J.indexOf("[",12),z=J.lastIndexOf("]");if($!==-1&&z>$){let B=J.slice($+1,z).trim();return`Promise<[${U(B).map((G)=>{let j=G.trim();if(j.startsWith("Promise.resolve(")){let O=y(j,Y,X+1),Q=O.indexOf("<"),K=O.lastIndexOf(">");return Q!==-1&&K>Q?O.slice(Q+1,K):"unknown"}return V(j,Y,!1,X+1)}).join(", ")}]>`}return"Promise<unknown[]>"}return"Promise<unknown>"}function D(J,Y,X=0){let $=J.slice(1,-1).trim();if(!$)return"never[]";if(X>=20)return"unknown[]";let z=U($),B=!1;for(let Q=0;Q<z.length;Q++){let K=z[Q],F=K.length;while(F>0&&K.charCodeAt(F-1)<=32)F--;if(F>=8&&K.slice(F-8,F)==="as const"){B=!0;break}}if(B)return`readonly [
|
|
3
|
-
${z.map((K)=>{let F=K.trim();if(F.endsWith("as const")){let L=F.slice(0,-8).trim();if(L.startsWith("[")&&L.endsWith("]")){let W=L.slice(1,-1).trim();return`readonly [${U(W).map((R)=>V(R.trim(),!0,!1,X+1)).join(", ")}]`}return V(L,!0,!1,X+1)}if(F.startsWith("[")&&F.endsWith("]"))return D(F,!0,X+1);return V(F,!0,!1,X+1)}).join(` |
|
|
4
|
-
`)}
|
|
5
|
-
]`;let Z=k&&!Y,H=[],G=[];for(let Q of z){let K=Q.trim(),F=M;if(M=null,K.startsWith("[")&&K.endsWith("]"))H.push(D(K,Y,X+1));else H.push(m(K,Y,X+1));if(Z)G.push(M);M=F}if(Z)if(_(J))M=P(J);else{let Q=[];for(let K=0;K<z.length;K++){let F=z[K].trim();if(F.endsWith("as const"))continue;if(w(F)||F==="null"||F==="undefined")Q.push(F);else if(F.startsWith("[")&&_(F))Q.push(P(F));else if(F.startsWith("{")){if(G[K])Q.push(G[K])}else{let L=V(F,!1,!1,0);if(L!=="unknown")Q.push(L)}}if(Q.length>0)M=`[${Q.join(", ")}]`}if(Y)return`readonly [${H.join(", ")}]`;let j=[],O=!0;for(let Q of H){let K=!1;for(let F of j)if(Q===F){K=!0;break}if(!K)j.push(Q);if(O){if(!(g(Q)||Q==="true"||Q==="false"||Q.charCodeAt(0)===34&&Q.charCodeAt(Q.length-1)===34||Q.charCodeAt(0)===39&&Q.charCodeAt(Q.length-1)===39))O=!1}}if(O&&H.length<=10)return`readonly [${H.join(", ")}]`;if(j.length===1)return`${j[0]}[]`;return`(${j.join(" | ")})[]`}function U(J){let Y=[],X=0,$=0,z=!1,B=0;for(let H=0;H<J.length;H++){let G=J.charCodeAt(H);if(!z&&(G===34||G===39||G===96))z=!0,B=G;else if(z&&G===B&&(H===0||J.charCodeAt(H-1)!==92))z=!1;if(!z){if(G===91||G===123||G===40)$++;else if(G===93||G===125||G===41)$--;else if(G===44&&$===0){let j=J.substring(X,H).trim();if(j)Y.push(j);X=H+1;continue}}}let Z=J.substring(X).trim();if(Z)Y.push(Z);return Y}function w(J){if(g(J))return!0;if(J==="true"||J==="false")return!0;if(J.startsWith('"')&&J.endsWith('"')||J.startsWith("'")&&J.endsWith("'"))return!0;return!1}function s(J){return J==="number"||J==="string"||J==="boolean"}function _(J){let Y=!1,X=0,$=J.length;for(let z=0;z<$;z++){let B=J.charCodeAt(z);if(Y){if(B===92){z++;continue}if(B===X)Y=!1;continue}if(B===34||B===39||B===96){Y=!0,X=B;continue}if(B===61&&z+1<$&&J.charCodeAt(z+1)===62)return!1;if(B>=97&&B<=122){let Z=z;while(z<$&&(J.charCodeAt(z)>=97&&J.charCodeAt(z)<=122||J.charCodeAt(z)>=65&&J.charCodeAt(z)<=90||J.charCodeAt(z)>=48&&J.charCodeAt(z)<=57||J.charCodeAt(z)===95||J.charCodeAt(z)===36))z++;let H=J.slice(Z,z);if(H==="new"||H==="async"||H==="await"||H==="function"||H==="yield"||H==="console"||H==="process")return!1;let G=z;while(G<$&&J.charCodeAt(G)<=32)G++;if(G<$&&J.charCodeAt(G)===40)return!1;z--}}return!0}function i(J,Y,X=0){let $=J.slice(1,-1).trim();if(!$)return"{}";if(X>=20)return"Record<string, unknown>";let z=a($),B=[],Z=k&&!Y,H=[];for(let[G,j]of z){let O=M;M=null;let Q=V(j,Y,!1,X+1),K=M;if(M=O,Q.includes("=>")||Q.includes("function")||Q.includes("async"))Q=I(Q);let F=j.trim();if(!Y&&s(Q)&&w(F))B.push(`/** @defaultValue ${F} */
|
|
6
|
-
${G}: ${Q}`);else B.push(`${G}: ${Q}`);if(Z){let L=p(G);if(F.endsWith("as const"));else if(w(F))H.push(`${L}: ${F}`);else if(F.startsWith("[")&&_(F))H.push(`${L}: ${P(F)}`);else if(F.startsWith("{")){if(K)H.push(`${L}: ${K}`)}else if(!F.startsWith("[")&&(F.includes("=>")||F.startsWith("function")||F.startsWith("async"))){let W=h(F,!1,0,!0);H.push(`${L}: ${W}`)}}}if(Z&&H.length>0){let G=X>0?(X-1)/2:0,j=`{ ${H.join(", ")} }`;if(j.length<=80)M=j;else{let O=" ".repeat((G+1)*2),Q=" ".repeat(G*2);M=`{
|
|
7
|
-
${O}${H.join(`,
|
|
8
|
-
${O}`)}
|
|
9
|
-
${Q}}`}}return`{
|
|
10
|
-
${B.join(`;
|
|
11
|
-
`)}
|
|
12
|
-
}`}function I(J){let X=J.split(`
|
|
13
|
-
`).map((O)=>u(O)).join(`
|
|
14
|
-
`),$=X.indexOf("async");if($!==-1){let O=$>0?X.charCodeAt($-1):32,Q=$+5<X.length?X.charCodeAt($+5):32;if(!T(O)&&!T(Q))X=(X.slice(0,$)+X.slice($+5)).trim()}let z=X.indexOf("(");if(z!==-1){let O=x(X,z,"(",")");if(O!==-1){let Q=X.slice(z,O+1),K=b(Q);X=X.slice(0,z)+K+X.slice(O+1)}}let B=X.length,Z="",H=[],G=!1,j=!1;for(let O=0;O<B;O++){let Q=X.charCodeAt(O);if(Q===123||Q===40)H.push(Q);else if(Q===125||Q===41)H.pop();if(Q<=32){if(G=!0,Q===10||Q===13)j=!0;continue}if(G&&Z.length>0){let F=(H.length>0?H[H.length-1]:0)===123;if(j&&F){let L=Z.charCodeAt(Z.length-1),W=L===59||L===44||L===123||Q===125,q=Z.length>=2&&Z.charCodeAt(Z.length-1)===47&&Z.charCodeAt(Z.length-2)===42;if(!W&&!q)Z+="; ";else Z+=" "}else Z+=" "}G=!1,j=!1,Z+=X[O]}return Z.trim()}function T(J){return J>=97&&J<=122||J>=65&&J<=90||J>=48&&J<=57||J===95||J===36}function b(J){let Y=J.trim(),X,$=!1;if(Y.startsWith("(")&&Y.endsWith(")"))X=Y.slice(1,-1),$=!0;else X=Y;let z=X.trim();if(!z)return $?"()":"";let B=!1;{let L=0;for(let W=0;W<z.length;W++){let q=z.charCodeAt(W);if(q===40||q===60||q===91||q===123)L++;else if(q===41||q===62||q===93||q===125)L--;else if(L===0&&q===61){let N=W>0?z.charCodeAt(W-1):0,R=W+1<z.length?z.charCodeAt(W+1):0;if(N!==61&&N!==33&&N!==60&&N!==62&&R!==61&&R!==62){B=!0;break}}}}if(!B)return Y;let Z=[],H=[],G=0,j=0,O=!1,Q=0;for(let L=0;L<=z.length;L++){if(L===z.length){Z.push(z.slice(G));break}let W=z.charCodeAt(L);if(O){if(W===92){L++;continue}if(W===Q)O=!1;continue}if(W===39||W===34||W===96){O=!0,Q=W;continue}if(W===40||W===60||W===91||W===123)j++;else if(W===41||W===62||W===93||W===125)j--;else if(W===44&&j===0){Z.push(z.slice(G,L));let q=",",N=L+1;while(N<z.length&&z.charCodeAt(N)<=32)q+=z[N],N++;H.push(q),G=N}}let K=[];for(let L of Z){let W=L.trim();if(!W){K.push(L);continue}if(W.startsWith("//"))continue;let q=u(W),N=L.slice(0,L.length-L.trimStart().length);K.push(N+n(q))}let F=K[0]||"";for(let L=1;L<K.length;L++)F+=(H[L-1]||", ")+K[L];return $?`(${F})`:F}function u(J){let Y=!1,X=0;for(let $=0;$<J.length-1;$++){let z=J.charCodeAt($);if(Y){if(z===92){$++;continue}if(z===X)Y=!1;continue}if(z===39||z===34||z===96){Y=!0,X=z;continue}if(z===47&&J.charCodeAt($+1)===47)return J.slice(0,$).trimEnd()}return J}function n(J){if(J.startsWith("..."))return J;let Y=-1,X=-1,$=0,z=!1,B=0;for(let H=0;H<J.length;H++){let G=J.charCodeAt(H);if(z){if(G===92){H++;continue}if(G===B)z=!1;continue}if(G===39||G===34||G===96){z=!0,B=G;continue}if(G===40||G===60||G===91||G===123)$++;else if(G===41||G===62||G===93||G===125)$--;else if($===0){if(G===58&&Y===-1)Y=H;else if(G===61&&X===-1&&(H===0||J.charCodeAt(H-1)!==61)&&(H+1>=J.length||J.charCodeAt(H+1)!==61&&J.charCodeAt(H+1)!==62))X=H}}let Z=X!==-1;if(Y!==-1&&(X===-1||Y<X)){let H=J.slice(0,Y).trim(),G=X!==-1?J.slice(Y+1,X).trim():J.slice(Y+1).trim(),j=Z&&!H.endsWith("?")?"?":"";return`${H}${j}: ${G}`}else if(X!==-1){let H=J.slice(0,X).trim(),G=!H.endsWith("?")?"?":"",j=J.slice(X+1).trim(),O="unknown";if(j==="true"||j==="false")O="boolean";else if(/^-?\d+(\.\d+)?$/.test(j))O="number";else if(j.startsWith("'")&&j.endsWith("'")||j.startsWith('"')&&j.endsWith('"'))O="string";else if(j.startsWith("["))O="unknown[]";else if(j.startsWith("{"))O="Record<string, unknown>";return`${H}${G}: ${O}`}return J}function a(J){let Y=[],X="",$="",z=0,B=!1,Z="",H=!0,G=!1,j=0;for(let O=0;O<J.length;O++){let Q=J[O],K=O>0?J[O-1]:"",F=O<J.length-1?J[O+1]:"";if(!B&&!G&&Q==="/"&&F==="/"){O+=2;while(O<J.length&&J[O]!==`
|
|
15
|
-
`)O++;continue}if(!B&&!G&&Q==="/"&&F==="*"){G=!0,j=1,X+="/*",O++;continue}else if(G&&Q==="*"&&F==="/"){if(j--,X+="*/",O++,j===0)G=!1;continue}else if(G&&Q==="/"&&F==="*"){j++,X+="/*",O++;continue}if(!B&&(Q==='"'||Q==="'"||Q==="`"))B=!0,Z=Q,X+=Q;else if(B&&Q===Z&&K!=="\\")B=!1,X+=Q;else if(!B&&!G)if(Q==="("&&z===0&&H){if($=X.trim(),$.startsWith("async "))$=$.slice(6).trim();X=Q,H=!1,z=1}else if(Q==="{"||Q==="["||Q==="(")z++,X+=Q;else if(Q==="}"||Q==="]"||Q===")")z--,X+=Q;else if(Q===":"&&z===0&&H)$=X.trim(),X="",H=!1;else if(Q===","&&z===0){if($&&X.trim()){let L=X.trim();if(L.startsWith("("))L=C($,L);else if(L.includes("=>")||L.includes("function")||L.includes("async"))L=I(L);Y.push([$,L])}X="",$="",H=!0}else X+=Q;else X+=Q}if($&&X.trim()){let O=X.trim();if(O.startsWith("("))O=C($,O);else if(O.includes("=>")||O.includes("function")||O.includes("async"))O=I(O);Y.push([$,O])}return Y}function C(J,Y){let X=Y,$=0;while($<X.length&&X.charCodeAt($)<=32)$++;if(X.startsWith("async",$)&&$+5<X.length&&X.charCodeAt($+5)<=32)X=X.slice($+5).trimStart();let z="";if(X.charCodeAt(0)===60){let Q=0,K=-1;for(let F=0;F<X.length;F++)if(X.charCodeAt(F)===60)Q++;else if(X.charCodeAt(F)===62){if(Q--,Q===0){K=F;break}}if(K!==-1)z=X.slice(0,K+1),X=X.slice(K+1).trimStart()}let B=X.indexOf("("),Z=x(X,B,"(",")");if(B===-1||Z===-1)return"() => unknown";let H=X.slice(B,Z+1),G="unknown",j=X.slice(Z+1).trimStart();if(j.charCodeAt(0)===58){let Q=j.slice(1),K=0,F=-1,L=!1;for(let W=0;W<Q.length;W++){let q=Q.charCodeAt(W);if(q===40||q===91)K++;else if(q===41||q===93)K--;else if(q===123&&K===0){F=W;break}else if(q===61&&W+1<Q.length&&Q.charCodeAt(W+1)===62&&K===0){F=W,L=!0;break}}if(F!==-1)G=Q.slice(0,F).trim();else G=Q.trim()}let O=b(H);return`${z}${O} => ${G}`}function x(J,Y,X,$){let z=0;for(let B=Y;B<J.length;B++)if(J[B]===X)z++;else if(J[B]===$){if(z--,z===0)return B}return-1}function r(J){let Y=0,X=0,$=!1,z="";for(let B=0;B<J.length-1;B++){let Z=J[B],H=J[B+1],G=B>0?J[B-1]:"";if(!$&&(Z==='"'||Z==="'"||Z==="`"))$=!0,z=Z;else if($&&Z===z&&G!=="\\")$=!1;if(!$){if(Z==="(")Y++;else if(Z===")")Y--;else if(Z==="[")X++;else if(Z==="]")X--;if(Z==="="&&H===">"&&Y===0&&X===0)return B}}return-1}function h(J,Y=!1,X=0,$=!0){let z=J.trim();if(z.length>200&&E(z,"=>")>2&&E(z,"<")>5&&!z.startsWith("function"))return Y?"((...args: any[]) => any)":"(...args: any[]) => any";if(z.startsWith("async ")&&z.includes("=>")){let Z=z.slice(5).trim(),H=Z.indexOf("=>"),G=Z.substring(0,H).trim(),j=Z.substring(H+2).trim();if(G=b(G),G==="()"||G==="")G="()";else if(!G.startsWith("("))G=`(${G})`;let O="unknown";if(j.startsWith("{"))O="unknown";else O=V(j,$,!1,X+1);let Q=`${G} => Promise<${O}>`;return Y?`(${Q})`:Q}if(z.includes("=>")){let Z="",H=z;if(z.startsWith("<")){let W=x(z,0,"<",">");if(W!==-1)Z=z.substring(0,W+1),H=z.substring(W+1).trim()}let G=r(H);if(G===-1)return Y?"(() => unknown)":"() => unknown";let j=H.substring(0,G).trim(),O=H.substring(G+2).trim(),Q="",K=j.lastIndexOf("):");if(K!==-1){let W=j.substring(K+2).trim();if(W&&!W.includes("=>")&&!W.includes("="))Q=W,j=j.substring(0,K+1)}if(j=b(j),j==="()"||j==="")j="()";else if(!j.startsWith("("))j=`(${j})`;let F="unknown";if(Q)F=Q;else if(O.startsWith("{"))F="unknown";else if(O.includes("=>")){let W=O.trimStart(),q=W.indexOf("("),N=q!==-1?W.indexOf(")",q):-1,R=N!==-1?W.indexOf("=>",N):-1;if(q===0&&N!==-1&&R!==-1){let A=W.substring(q+1,N).trim();if(Z.includes("T")&&A.includes("T"))F=`(${A}) => T`;else F=`(${A}) => any`}else F="any"}else if(Y)F="unknown";else F=V(O,$,!1,X+1);let L=`${Z}${j} => ${F}`;return Y?`(${L})`:L}if(z.startsWith("function")){let Z=8,H=z.length;while(Z<H&&z.charCodeAt(Z)<=32)Z++;let G=!1;if(Z<H&&z.charCodeAt(Z)===42){G=!0,Z++;while(Z<H&&z.charCodeAt(Z)<=32)Z++}let j="";if(Z<H&&z.charCodeAt(Z)===60){let K=Z,F=1;Z++;while(Z<H&&F>0){let L=z.charCodeAt(Z);if(L===60)F++;else if(L===62)F--;Z++}j=z.substring(K,Z);while(Z<H&&z.charCodeAt(Z)<=32)Z++}let O=z.indexOf("(",Z);if(O!==-1){let K=1,F=O+1;while(F<H&&K>0){let N=z.charCodeAt(F);if(N===40)K++;else if(N===41)K--;F++}let L=z.substring(O+1,F-1).trim(),W=L?`(${L})`:"()";if(G){let N=z.substring(F).trim(),R=N.indexOf("Generator<");if(R!==-1){let S=R+10,f=N.indexOf(">",S);if(f!==-1){let o=N.substring(S,f),v=`${j}${W} => Generator<${o}>`;return Y?`(${v})`:v}}let A=`${j}${W} => Generator<any, any, any>`;return Y?`(${A})`:A}let q=`${j}${W} => unknown`;return Y?`(${q})`:q}let Q="(...args: any[]) => unknown";return Y?`(${Q})`:Q}if(z.includes("=>")&&z.includes("(")&&z.includes(")")){if(z.length>100||E(z,"=>")>2){let Z="";if(z.charCodeAt(0)===60){let Q=z.indexOf(">");if(Q!==-1)Z=z.substring(0,Q+1)}let H=z.indexOf("("),G=H!==-1?z.indexOf(")",H):-1,j=H!==-1&&G!==-1?z.substring(H,G+1):"(...args: any[])",O=`${Z}${j} => any`;return Y?`(${O})`:O}return Y?`(${z})`:z}let B="() => unknown";return Y?`(${B})`:B}function zz(J){let Y=J.trim();if(Y==="any"||Y==="object"||Y==="unknown")return!0;if(Y.startsWith("Record<")&&Y.endsWith(">"))return!0;if(Y.startsWith("Array<")&&Y.endsWith(">"))return!0;if(/^\{\s*\[[^\]]*\]:\s*(any|string|number|unknown)\s*\}$/.test(Y))return!0;return!1}function Jz(J){let Y=J.lastIndexOf(" satisfies ");if(Y===-1)return null;let X=J.slice(Y+11).trim();if(X.endsWith(";"))X=X.slice(0,-1).trim();return X||null}function Yz(J){let Y=[],X=0;for(let $=0;$<=J.length;$++)if($===J.length||J[$]===`
|
|
16
|
-
`){let z=X,B=$;while(z<B&&(J[z]===" "||J[z]==="\t"||J[z]==="\r"))z++;while(B>z&&(J[B-1]===" "||J[B-1]==="\t"||J[B-1]==="\r"))B--;let Z=J.slice(z,B);if(X=$+1,Z.startsWith("///")){if(Z.match(/^\/\/\/\s*<reference\s+(path|types|lib|no-default-lib)\s*=\s*["'][^"']+["']\s*\/>/))Y.push(Z);else if(Z.match(/^\/\/\/\s*<amd-module\s+name\s*=\s*["'][^"']+["']\s*\/>/))Y.push(Z);else if(Z.match(/^\/\/\/\s*<amd-dependency\s+path\s*=\s*["'][^"']+["']/))Y.push(Z)}else if(Z===""||Z.startsWith("//"))continue;else break}return Y}
|
|
17
|
-
export{t as Cc,e as Dc,V as Ec,m as Fc,D as Gc,U as Hc,i as Ic,x as Jc,h as Kc,zz as Lc,Jz as Mc,Yz as Nc};
|
package/dist/chunk-te9r0j9z.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{hc as z}from"./chunk-94h87sgb.js";import{ad as R}from"./chunk-ns3hznyf.js";var V=R(z(),1);import{readFile as I}from"fs/promises";import{dirname as T,relative as $,resolve as k}from"path";async function M(j,B={}){let A=new Map,K=B.rootDir||process.cwd();for(let H of j){if(B.ignore?.some((L)=>q(H,L)))continue;if(!B.includeNodeModules&&H.includes("node_modules"))continue;let Q=await b(H,K);if(Q)A.set(H,Q)}for(let[H,Q]of A)for(let L of Q.dependencies){let U=A.get(L);if(U)U.dependents.add(H)}return A}async function b(j,B){try{let A=await I(j,"utf-8"),K=V.default.createSourceFile(j,A,V.default.ScriptTarget.Latest,!0,V.default.ScriptKind.TS),H={path:j,exports:new Set,imports:new Map,dependencies:new Set,dependents:new Set};return V.default.forEachChild(K,(Q)=>{F(Q,H,j,B)}),H}catch{return null}}function F(j,B,A,K){if(V.default.isImportDeclaration(j)){let H=j.moduleSpecifier;if(V.default.isStringLiteral(H)){let Q=w(H.text,A,K);if(Q){B.dependencies.add(Q);let L=j.importClause;if(L){if(L.name)B.imports.set(L.name.text,Q);if(L.namedBindings){if(V.default.isNamedImports(L.namedBindings))for(let U of L.namedBindings.elements)B.imports.set(U.name.text,Q);else if(V.default.isNamespaceImport(L.namedBindings))B.imports.set(L.namedBindings.name.text,Q)}}}}}if(V.default.isExportDeclaration(j)){if(j.moduleSpecifier&&V.default.isStringLiteral(j.moduleSpecifier)){let H=w(j.moduleSpecifier.text,A,K);if(H)B.dependencies.add(H)}if(j.exportClause&&V.default.isNamedExports(j.exportClause))for(let H of j.exportClause.elements)B.exports.add(H.name.text)}if(V.default.isFunctionDeclaration(j)&&j.name&&X(j))B.exports.add(j.name.text);if(V.default.isClassDeclaration(j)&&j.name&&X(j))B.exports.add(j.name.text);if(V.default.isInterfaceDeclaration(j)&&X(j))B.exports.add(j.name.text);if(V.default.isTypeAliasDeclaration(j)&&X(j))B.exports.add(j.name.text);if(V.default.isEnumDeclaration(j)&&X(j))B.exports.add(j.name.text);if(V.default.isVariableStatement(j)&&X(j)){for(let H of j.declarationList.declarations)if(V.default.isIdentifier(H.name))B.exports.add(H.name.text)}}function X(j){return(V.default.canHaveModifiers(j)?V.default.getModifiers(j):void 0)?.some((A)=>A.kind===V.default.SyntaxKind.ExportKeyword)??!1}function w(j,B,A){if(!j.startsWith(".")&&!j.startsWith("/"))return null;let K=T(B),H=k(K,j),Q=[".ts",".tsx",".d.ts","/index.ts","/index.tsx","/index.d.ts"];for(let L of Q){let U=H.endsWith(".ts")||H.endsWith(".tsx")?H:H+L;if(!U.includes("node_modules"))return U.replace(/\.tsx?$/,".ts")}return`${H}.ts`}function q(j,B){let A=B.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp(A).test(j)}function E(j,B={}){let A=[],K=new Set,H=new Set,Q=B.maxDepth||100;function L(U,W,G){if(G>Q)return;if(H.has(U)){let Y=W.indexOf(U),Z=[...W.slice(Y),U],O=S(Z,j),_=v(Z,j);if(!B.typesOnly||_)A.push({chain:Z,symbols:O,severity:_?"error":"warning",reason:_?"Type-level circular dependency can cause compilation issues":"Value-level circular dependency may cause runtime issues"});return}if(K.has(U))return;let J=j.get(U);if(!J)return;K.add(U),H.add(U),W.push(U);for(let Y of J.dependencies)L(Y,[...W],G+1);H.delete(U)}for(let U of j.keys())K.clear(),H.clear(),L(U,[],0);return C(A)}function S(j,B){let A=[];for(let K=0;K<j.length-1;K++){let H=B.get(j[K]),Q=j[K+1];if(H){for(let[L,U]of H.imports)if(U===Q)A.push(L)}}return[...new Set(A)]}function v(j,B){return j.some((A)=>A.endsWith(".d.ts")||B.get(A)?.exports.has("type")||[...B.get(A)?.imports.keys()||[]].some((K)=>K.startsWith("type ")||K==="type"))}function C(j){let B=new Set,A=[];for(let K of j){let H=x(K.chain),Q=H.join(" -> ");if(!B.has(Q))B.add(Q),A.push({...K,chain:H})}return A}function x(j){if(j.length<=1)return j;let B=j.slice(0,-1),A=B;for(let K=1;K<B.length;K++){let H=[...B.slice(K),...B.slice(0,K)];if(H.join("")<A.join(""))A=H}return[...A,A[0]]}async function g(j,B={}){let A=Date.now(),K=await M(j,B),H=E(K,B);return{hasCircular:H.length>0,cycles:H,graph:K,filesAnalyzed:j,durationMs:Date.now()-A}}function y(j,B){let A=[];if(!j.hasCircular)return A.push(`\u2713 No circular dependencies found (${j.filesAnalyzed.length} files analyzed in ${j.durationMs}ms)`),A.join(`
|
|
3
|
-
`);A.push(`\u2717 Found ${j.cycles.length} circular dependency chain(s)`),A.push("");for(let K of j.cycles){let H=K.severity==="error"?"\uD83D\uDD34":"\uD83D\uDFE1";A.push(`${H} ${K.severity.toUpperCase()}: Circular dependency`);let Q=K.chain.map((L)=>B?$(B,L):L);if(A.push(` ${Q.join(" \u2192 ")}`),K.symbols.length>0)A.push(` Symbols: ${K.symbols.join(", ")}`);A.push(` ${K.reason}`),A.push("")}return A.push(`Analyzed ${j.filesAnalyzed.length} files in ${j.durationMs}ms`),A.join(`
|
|
4
|
-
`)}function m(j){let B=0,A={file:"",count:0},K={file:"",count:0},H=[];for(let[Q,L]of j){let U=L.dependencies.size;if(B+=U,U>A.count)A={file:Q,count:U};if(U===0&&L.dependents.size===0)H.push(Q);if(L.dependents.size>K.count)K={file:Q,count:L.dependents.size}}return{totalFiles:j.size,totalDependencies:B,avgDependencies:j.size>0?B/j.size:0,maxDependencies:A,isolatedFiles:H,mostDepended:K}}function P(j,B){let A=new Set,K=[j];while(K.length>0){let H=K.shift(),Q=B.get(H);if(Q){for(let L of Q.dependents)if(!A.has(L))A.add(L),K.push(L)}}return A}function u(j,B){let A=new Set,K=[j];while(K.length>0){let H=K.shift(),Q=B.get(H);if(Q){for(let L of Q.dependencies)if(!A.has(L))A.add(L),K.push(L)}}return A}function f(j,B){let A=["digraph dependencies {"," rankdir=LR;"," node [shape=box];",""];for(let[K,H]of j){let Q=B?$(B,K):K,L=K.replace(/[^a-z0-9]/gi,"_");A.push(` ${L} [label="${Q}"];`);for(let U of H.dependencies){let W=U.replace(/[^a-z0-9]/gi,"_");A.push(` ${L} -> ${W};`)}}return A.push("}"),A.join(`
|
|
5
|
-
`)}function c(j,B){let A=[];for(let[K,H]of j){let Q=B?$(B,K):K;A.push({id:K,path:Q,exports:[...H.exports],imports:Object.fromEntries(H.imports),dependencies:[...H.dependencies],dependents:[...H.dependents]})}return JSON.stringify({nodes:A},null,2)}
|
|
6
|
-
export{M as Q,E as R,g as S,y as T,m as U,P as V,u as W,f as X,c as Y};
|
package/dist/chunk-trftkghj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{a,b,c}from"./chunk-49b3ran6.js";import"./chunk-b0bkjk0p.js";import"./chunk-94h87sgb.js";import"./chunk-50hbgzrj.js";import"./chunk-2vw7w2j4.js";import"./chunk-sv136qag.js";import"./chunk-ns3hznyf.js";export{b as optimizeFile,a as optimizeDeclarations,c as minifyDts};
|
package/dist/chunk-xqymptjk.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{tb as b,ub as c,vb as d}from"./chunk-jfk0hw36.js";import"./chunk-b0bkjk0p.js";import"./chunk-94h87sgb.js";import{ic as a}from"./chunk-6jpqpjkc.js";import"./chunk-50hbgzrj.js";import"./chunk-2vw7w2j4.js";import"./chunk-pdvve1gm.js";import"./chunk-sv136qag.js";import"./chunk-365avtde.js";import"./chunk-57agx6g8.js";import"./chunk-ns3hznyf.js";export{d as watch,a as processSource,c as processFile,b as generate};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Declaration } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Extract declarations using the fast string scanner (no TS parser).
|
|
4
|
-
* Results are cached by file path + keepComments flag.
|
|
5
|
-
*/
|
|
6
|
-
export declare function extractDeclarations(sourceCode: string, filePath: string, keepComments?: boolean, isolatedDeclarations?: boolean): Declaration[];
|
|
7
|
-
/**
|
|
8
|
-
* Clear the declaration cache (for benchmarks and testing)
|
|
9
|
-
*/
|
|
10
|
-
export declare function clearDeclarationCache(): void;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Declaration } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Scan TypeScript source code and extract declarations without using the TypeScript parser.
|
|
4
|
-
* This is the fast path that replaces createSourceFile() + AST walk.
|
|
5
|
-
*/
|
|
6
|
-
export declare function scanDeclarations(_source: string, _filename: string, _keepComments?: boolean, _isolatedDeclarations?: boolean): Declaration[];
|