scip-query 0.6.9 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-23YIGCYF.js +25 -0
- package/dist/{chunk-V4WRHJU3.js → chunk-2IYEIFPP.js} +6 -6
- package/dist/chunk-2JEFS2YJ.js +2 -0
- package/dist/chunk-33SSUPCB.js +7 -0
- package/dist/chunk-3GNFUVFA.js +2 -0
- package/dist/chunk-3OUC276S.js +2 -0
- package/dist/{chunk-JLFAQ2E2.js → chunk-4STLJYHI.js} +4 -4
- package/dist/chunk-563HLCDW.js +35 -0
- package/dist/chunk-5TT47UMX.js +44 -0
- package/dist/chunk-6H2XIIPY.js +71 -0
- package/dist/{chunk-I5BB33E6.js → chunk-72JOIFXL.js} +3 -3
- package/dist/chunk-7H4RJ4MC.js +2 -0
- package/dist/chunk-7O4MJYIW.js +63 -0
- package/dist/chunk-7OX2O53H.js +62 -0
- package/dist/chunk-A2AVLALL.js +2 -0
- package/dist/chunk-AQYBOORI.js +2 -0
- package/dist/chunk-ARBZM2NF.js +34 -0
- package/dist/{chunk-GRAEZYYU.js → chunk-BI4F6GXI.js} +2 -2
- package/dist/chunk-BOVNTAKQ.js +3 -0
- package/dist/chunk-CKIO6SVS.js +2 -0
- package/dist/chunk-D6Z67MZL.js +2 -0
- package/dist/chunk-DFK54IRN.js +2 -0
- package/dist/chunk-FD37DBTD.js +2 -0
- package/dist/chunk-FOQQDXE7.js +2 -0
- package/dist/chunk-GAQGJ52J.js +11 -0
- package/dist/chunk-IODTPF5H.js +20 -0
- package/dist/chunk-J6Z5YKGQ.js +4 -0
- package/dist/chunk-JB4PUN5S.js +40 -0
- package/dist/chunk-JTXKS5GK.js +3 -0
- package/dist/chunk-KJ3ZJIE5.js +2 -0
- package/dist/chunk-KJ6CW6EK.js +2 -0
- package/dist/{chunk-AXHDRSRI.js → chunk-KNA6Z7JB.js} +3 -3
- package/dist/{chunk-U3GYMGBX.js → chunk-LDV2B7ET.js} +8 -8
- package/dist/chunk-LWYIGRHR.js +5 -0
- package/dist/chunk-MDAYGS6T.js +2 -0
- package/dist/chunk-MX6F756F.js +2 -0
- package/dist/chunk-NHDPYW7O.js +2 -0
- package/dist/{chunk-IIKNAXAE.js → chunk-NKJKI6SE.js} +2 -2
- package/dist/chunk-NN3O7TPH.js +8 -0
- package/dist/chunk-NSTZMBAB.js +18 -0
- package/dist/chunk-NYEMZHUC.js +6 -0
- package/dist/chunk-OHEIZWIA.js +4 -0
- package/dist/chunk-PG3ZI5IH.js +2 -0
- package/dist/chunk-QAEDNTY7.js +2 -0
- package/dist/chunk-QE6MGGUY.js +2 -0
- package/dist/chunk-QPRIYXH4.js +2 -0
- package/dist/chunk-QWJBIBE6.js +3 -0
- package/dist/chunk-RCJEFQOK.js +4 -0
- package/dist/chunk-ROOHENEP.js +61 -0
- package/dist/{chunk-3JGBAAP7.js → chunk-ROZNBWIF.js} +2 -2
- package/dist/chunk-TGK5DFBJ.js +2 -0
- package/dist/chunk-TKDJQ2WD.js +59 -0
- package/dist/chunk-TRNAQABL.js +7 -0
- package/dist/chunk-U75WH4XG.js +2 -0
- package/dist/chunk-V53J46BX.js +2 -0
- package/dist/chunk-V76FCF5F.js +2 -0
- package/dist/chunk-VUBQBW7H.js +16 -0
- package/dist/chunk-WJQY2LGT.js +2 -0
- package/dist/{chunk-ZO5IFJRM.js → chunk-WODJHE6Z.js} +3 -3
- package/dist/{chunk-IX45SWX5.js → chunk-WPLKHAH7.js} +4 -4
- package/dist/chunk-XO6R3X5J.js +2 -0
- package/dist/chunk-YSZNAG4G.js +2 -0
- package/dist/chunk-ZNUPGRPR.js +3 -0
- package/dist/{chunk-UIM4WALN.js → chunk-ZXFTC5ET.js} +4 -4
- package/dist/cli.js +364 -527
- package/dist/config-types-CGIeLEpY.d.ts +108 -0
- package/dist/db-DdTPetj5.d.ts +69 -0
- package/dist/health-x7B4Xu_6.d.ts +119 -0
- package/dist/index.d.ts +100 -334
- package/dist/index.js +3 -131
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +9 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +12 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +12 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +19 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +16 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/code.d.ts +12 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +15 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +19 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +22 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +8 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +16 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +32 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +34 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +8 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +6 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +22 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/drift.d.ts +18 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +19 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +7 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +6 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +4 -81
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +8 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +10 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +13 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/index.d.ts +45 -44
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +11 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.d.ts +10 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +8 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +10 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +14 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +13 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +7 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/similar-chains.d.ts +21 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +12 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +16 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +21 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +16 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +36 -3
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +11 -2
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +8 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +10 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +10 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +18 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +14 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +10 -10
- package/dist/reindex.d.ts +153 -0
- package/dist/reindex.js +69 -0
- package/dist/runtime.d.ts +108 -0
- package/dist/runtime.js +3 -0
- package/dist/scip-cli-a-xOztiK.d.ts +20 -0
- package/package.json +184 -4
- package/dist/chunk-2OP63JQQ.js +0 -2
- package/dist/chunk-33Z6HQBX.js +0 -5
- package/dist/chunk-3F453KPT.js +0 -2
- package/dist/chunk-3PKPUCIJ.js +0 -11
- package/dist/chunk-42BWO2NN.js +0 -2
- package/dist/chunk-4MDCFY3E.js +0 -2
- package/dist/chunk-4QWTQ6YV.js +0 -2
- package/dist/chunk-5IRX5I64.js +0 -5
- package/dist/chunk-5MPZ2A7J.js +0 -2
- package/dist/chunk-67OMD56K.js +0 -90
- package/dist/chunk-6UVVA5I4.js +0 -7
- package/dist/chunk-BAA4EJRX.js +0 -2
- package/dist/chunk-BT36WY5B.js +0 -114
- package/dist/chunk-CLKFDBS6.js +0 -39
- package/dist/chunk-CWMWTHV3.js +0 -2
- package/dist/chunk-DXO2ECRF.js +0 -7
- package/dist/chunk-EHEZLULQ.js +0 -85
- package/dist/chunk-FVH3Y44U.js +0 -1
- package/dist/chunk-GWBRU65E.js +0 -2
- package/dist/chunk-H4DXD2FB.js +0 -5
- package/dist/chunk-I2KUHGMX.js +0 -16
- package/dist/chunk-JMASYYSW.js +0 -2
- package/dist/chunk-KAM4C6ZD.js +0 -4
- package/dist/chunk-LBWLO7NA.js +0 -70
- package/dist/chunk-LJ2YWNQF.js +0 -2
- package/dist/chunk-LLDPR3DG.js +0 -6
- package/dist/chunk-LNUZWWWL.js +0 -2
- package/dist/chunk-NLJCXHFU.js +0 -84
- package/dist/chunk-NRAJIFQA.js +0 -2
- package/dist/chunk-OYRGWW6Z.js +0 -2
- package/dist/chunk-PVMRIOM6.js +0 -33
- package/dist/chunk-QRYEOK3M.js +0 -2
- package/dist/chunk-SF2HYG53.js +0 -4
- package/dist/chunk-SHGPRVWH.js +0 -2
- package/dist/chunk-SMOUOKAO.js +0 -2
- package/dist/chunk-TBJDUS4E.js +0 -71
- package/dist/chunk-TPXWXKL6.js +0 -2
- package/dist/chunk-TTCUMJ43.js +0 -19
- package/dist/chunk-TYR7QY5G.js +0 -2
- package/dist/chunk-UZG3QXTG.js +0 -2
- package/dist/chunk-VDMRAGBK.js +0 -6
- package/dist/chunk-W6SRVK2Y.js +0 -5
- package/dist/chunk-WGYJDGBI.js +0 -25
- package/dist/chunk-WYX3RU2K.js +0 -2
- package/dist/chunk-WZYA234B.js +0 -2
- package/dist/chunk-Y6ZFXZ7B.js +0 -2
- package/dist/chunk-YCN5XEST.js +0 -7
- package/dist/db-Rx8Ho_JF.d.ts +0 -838
- package/dist/queries/drift-policy.d.ts +0 -6
- package/dist/queries/drift-policy.js +0 -2
- package/dist/queries/health-cache-control.d.ts +0 -15
- package/dist/queries/health-cache-control.js +0 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{B as Y,a as se,b as ne,c as b,d as oe,e as ie,f as ae,g as L,h as pe,i as U,j as ce,k as me,l as E,m as F,n as T,o as V,p as H,q as S,r as Q,s as W,x as C,y as h,z as M}from"./chunk-BOVNTAKQ.js";import{a as j,e as le,f as ue,j as R}from"./chunk-5TT47UMX.js";import{a as w}from"./chunk-NHDPYW7O.js";import{basename as de}from"path";var Ae=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(t){let r=[],e=0,s=0;for(let n=0;n<t.length;n++){let o=t[n];(o==="{"||o==="["||o==="(")&&e++,(o==="}"||o==="]"||o===")")&&e--,o===","&&e===0&&(r.push(t.slice(s,n)),s=n+1)}return r.push(t.slice(s)),r}function y(t,r){for(let e of t.namedChildren)if(e.type===r)return e;return null}function g(t,r){let e=new Set,s=(n,o)=>{let i=o||r.has(n.type);!i&&Ae.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function P(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,me(r)),kind:"named",used:h(e,o),usedMembers:[]}}function f(t,r,e,s,n="named",o={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function $(t,r,e,s,n="named",o=[],i={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s,usedMembers:o,isTypeOnly:i.isTypeOnly}}function D(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function O(t,r,e={}){return{importedName:t,localName:e.localName??null,sourcePath:r,kind:"namespace",used:e.used??!0,usedMembers:e.usedMembers??[],isTypeOnly:e.isTypeOnly}}function N(t,r,e){let s=[];for(let n of t.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=C(t,n.index,n.index+o.length);for(let a of e(n,i))s.push(a)}return s}function I(t,r,e,s){let n=R(t,r);if(n){let o=e(n);if(o)return o}return s()}function X(t,r,e,s){let n=R(t,r),o=le(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function fe(t,r,e){return I(t,r,s=>we(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=de(o).replace(/\.[^.]+$/,"");return[$(o,i,H(t,r,o),h(n,i))]})}function we(t,r,e){let s=g(e,new Set(["preproc_include"])),n=[];for(let o of e.rootNode.descendantsOfType("preproc_include")){let i=null;for(let p of o.namedChildren){if(p.type==="system_lib_string"){i=p.text.replace(/^<|>$/g,"");break}if(p.type==="string_literal"){i=p.namedChildren.find(c=>c.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=de(i).replace(/\.[^.]+$/,"");n.push(f(i,a,H(t,r,i),s))}return n}function ge(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=n[1]?.trim(),i=n[2]?.trim()??null,a=n[0];if(!o||!a||typeof n.index!="number")continue;let p=C(e,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:Q(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function Se(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:Q(t,r,o)})}return s}function he(t,r,e){return X(t,r,{csharp:s=>je(t,r,s),vb:s=>Le(t,r,s)},()=>{let s=ce(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(e,s,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let[a,p]=i.split(/\s*=\s*/),m=!!p,c=(m?p:a)?.trim()??i,l=c.split(".").pop()??c,u=m?a?.trim()??l:l;return[P(t,r,o,c,l,u,S(t,c,L))]})})}function Le(t,r,e){let s=g(e,new Set(["imports_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(u=>u.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],p=i.length>1?i[0]:null,m=a.text,c=m.split(".").pop()??m,l=p?.text??c;n.push(f(c,l,S(t,m,L),s,p?"namespace":"named"))}return n}function je(t,r,e){let s=g(e,new Set(["using_directive"])),n=[];for(let o of e.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,p;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],p=i[1]):p=i[i.length-1];let m=p.text,c=m.split(".").pop()??m,l=a?.text??c;n.push(f(c,l,S(t,m,L),s,a?"namespace":"named"))}return n}var Me=w("vue-non-script-identifiers");function xe(t,r){return Me.get(t,r,()=>{let e=new Set,s=j(t,r);if(!s)return e;let o=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))e.add(i[0]);return e})}function K(t,r,e){return I(t,r,s=>qe(t,r,s),()=>$e(t,r,e))}function $e(t,r,e){return Ye(e).flatMap(s=>Ke(t,r,s.clause,s.specifier,s.start,s.end,e))}function qe(t,r,e){let s=Ue(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...Fe(t,r,e,o,s));return n}function Ue(t,r,e){let s=g(e,new Set(["import_statement"]));if(ue(r))for(let n of xe(t,r))s.add(n);return s}function Fe(t,r,e,s,n){let o=ze(s);if(!o)return[];let i=E(t,r,o),a=y(s,"import_clause");return a?We(e,a,i,n,Ve(s.text)):[D("*",i)]}function We(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Je(i.text,e,s,n));else if(i.type==="namespace_import"){let a=Xe(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Be(i,e,s,n));return o}function Je(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function Xe(t,r,e,s,n){let i=y(r,"identifier")?.text??"";if(!i)return null;let a=Qe(t,i);return O("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Be(t,r,e,s){let n=[];for(let o of t.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let p=i.text,m=a?.text??p;n.push(f(p,m,r,e,"named",{isTypeOnly:s||He(o.text)}))}return n}function ze(t){let r=y(t,"string");if(!r)return null;let e=y(r,"string_fragment");return e?e.text:null}function Ve(t){return/^\s*import\s+type\b/.test(t)}function He(t){return/^\s*type\b/.test(t.trim())}function Qe(t,r){let e=new Set;for(let s of t.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),o=s.namedChild(1);!n||!o||n.type!=="identifier"||n.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&e.add(o.text)}return[...e]}function Ye(t){let r=[],e=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(e)){let o=n[0],i=n[1],a=n[2];!o||!a||typeof n.index!="number"||r.push({clause:i,specifier:a,start:n.index,end:n.index+o.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(s)){let o=n[0],i=n[1];!o||!i||typeof n.index!="number"||r.push({clause:null,specifier:i,start:n.index,end:n.index+o.length})}return r.sort((n,o)=>n.start-o.start)}function Ke(t,r,e,s,n,o,i){let a=E(t,r,s),p=C(i,n,o);return e?Ze(e).map(c=>({...c,sourcePath:a})).map(c=>{if(c.kind==="namespace"){let l=M(p,c.localName);return O(c.importedName,c.sourcePath,{localName:c.localName,usedMembers:l,used:l.length>0||h(p,c.localName),isTypeOnly:c.isTypeOnly})}return c.kind==="side-effect"?D(c.importedName,c.sourcePath):$(c.importedName,c.localName??"",c.sourcePath,c.localName?h(p,c.localName):!1,c.kind,[],{isTypeOnly:c.isTypeOnly})}):[D("*",a)]}function Ze(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=Ge(s),i=[];return n&&i.push(...ye(n,e)),o&&i.push(...ye(o,e)),i}function ye(t,r){let e=t.trim();if(!e)return[];if(e.startsWith("{")){let s=e.slice(1,-1).trim();return s?x(s).map(n=>{let o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[p,m]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(m??p).trim(),kind:"named",isTypeOnly:i}}):[]}return e.startsWith("* as ")?[{importedName:"*",localName:e.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:e,kind:"default",isTypeOnly:r}]}function Ge(t){let r=0;for(let e=0;e<t.length;e++){let s=t[e];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[t.slice(0,e).trim(),t.slice(e+1).trim()]}return[t.trim(),null]}function Z(t,r,e){let s=R(t,r);return s?ot(t,r,s):et(t,r,e)}function et(t,r,e){return[...tt(t,r,e),...rt(t,r,e),...st(t,r,e)]}function tt(t,r,e){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",p=x(i).map(l=>nt(l.trim())).filter(l=>!!l),m=q(e,o.index),c=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:E(t,r,a),names:p,startLine:m,endLine:c})}return s}function rt(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function st(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function nt(t){if(!t)return null;let r=t.replace(/^type\s+/,"").trim();if(!r)return null;let e=r.match(/^(\w+)\s+as\s+(\w+)$/);if(e)return e[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function q(t,r){let e=0;for(let s=0;s<r&&s<t.length;s++)t.charCodeAt(s)===10&&e++;return e}function ot(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=it(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=at(n,o,i,a);s.push(p)}return s}function it(t,r,e){let s=y(e,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return E(t,r,n.text)}function at(t,r,e,s){let n=y(t,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let p=a.namedChild(0),m=a.namedChild(1);p&&i.push((m??p).text)}return{kind:"named",sourcePath:r,names:i,startLine:e,endLine:s}}return y(t,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:e,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:e,endLine:s}}function Ne(t,r,e){return X(t,r,{java:s=>pt(t,r,s),kotlin:s=>ct(t,r,s),scala:s=>mt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?lt(t,r,o,n):[]}))}function pt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(l=>l.type==="asterisk"),p=o.namedChildren.find(l=>l.type==="scoped_identifier")??o.namedChildren.find(l=>l.type==="identifier");if(!p)continue;let m=p.text;if(i){n.push(O("*",S(t,m,b)));continue}let c=m.split(".").pop()??m;n.push(f(c,c,S(t,m,b),s))}return n}function ct(t,r,e){let s=g(e,new Set(["import_header","import_list"])),n=[];for(let o of e.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),p=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push(O("*",S(t,i.text,b)));continue}let m=i.text,c=m.split(".").pop()??m,u=p?.namedChild(0)?.text??c;n.push(f(c,u,S(t,m,b),s))}return n}function mt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(l=>l.type==="namespace_selectors"||l.type==="namespace_wildcard"),a=o.namedChildren.filter(l=>l!==i&&(l.type==="identifier"||l.type==="stable_identifier")),p=a.map(l=>l.text).join(".");if(!p)continue;if(i?.type==="namespace_wildcard"){n.push(O("*",S(t,p,b)));continue}if(i?.type==="namespace_selectors"){for(let l of i.namedChildren)if(l.type==="arrow_renamed_identifier"){let[u,d]=l.namedChildren;if(!u)continue;let _=u.text,A=d?.text??_;if(_==="_")continue;n.push(f(_,A,S(t,`${p}.${_}`,b),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,b),s))}continue}let m=a[a.length-1]?.text??p,c=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(m,m,S(t,c&&a.length>1?`${c}.${m}`:p,b),s))}return n}function lt(t,r,e,s){if(e.includes("{")&&e.includes("}")){let n=e.slice(0,e.indexOf("{")).replace(/\.$/,"").trim(),o=e.slice(e.indexOf("{")+1,e.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),c=p?.trim();if(!c||c==="_")return[];let l=(m??c.split(".").pop()??c).trim(),u=c==="_"?n:`${n}.${c}`.replace(/\.\./g,".");return[P(t,r,s,u,c,l)]})}return[P(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function be(t,r,e){return I(t,r,s=>ut(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.split(/\s+as\s+/i),c=p?.trim()??a,l=c.split("\\").pop()??c,u=(m??l).trim();return[P(t,r,n,c,l,u,S(t,c.replace(/\\/g,"."),U))]}):[]}))}function ut(t,r,e){let s=g(e,new Set(["namespace_use_declaration"])),n=[],o=(i,a,p)=>{n.push(f(a,p,S(t,i.replace(/\\/g,"."),U),s))};for(let i of e.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(p=>p.type==="namespace_use_group");if(a){let p=i.namedChildren.find(m=>m.type==="namespace_name")?.text??"";for(let m of a.namedChildren){if(m.type!=="namespace_use_clause")continue;let{importedName:c,localName:l,qualified:u}=Ie(m,p);c&&o(u,c,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:m,localName:c,qualified:l}=Ie(p,"");m&&o(l,m,c)}}return n}function Ie(t,r){let e=t.namedChildren.find(m=>m.type==="qualified_name"),s=t.namedChildren.filter(m=>m.type==="name"),n="";e?n=e.text:s.length>=1&&(n=s[0].text);let o=e&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,p=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:p}}function _e(t,r,e){return I(t,r,s=>dt(t,r,s),()=>gt(e).flatMap(s=>ht(t,r,s,e)))}function dt(t,r,e){let s=g(e,new Set(["import_statement","import_from_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Pe(i);if(!a)continue;let p=F(t,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:p,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of e.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ft(i);if(a===null)continue;let p=F(t,r,a);for(let m=1;m<o.namedChildCount;m+=1){let c=o.namedChild(m);if(c.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=Pe(c);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Pe(t){if(t.type==="aliased_import"){let r=t.namedChild(0),e=t.namedChild(1);return!r||!e?null:{qualifiedName:r.text,localName:e.text}}if(t.type==="dotted_name"){let r=t.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return t.type==="identifier"?{qualifiedName:t.text,localName:t.text}:null}function ft(t){if(t.type==="dotted_name")return t.text;if(t.type==="relative_import"){let r=y(t,"import_prefix")?.text??"",e=y(t,"dotted_name")?.text??"";return`${r}${e}`}return null}function gt(t){let r=t.split(`
|
|
2
|
+
`),e=[],s=0;for(let n=0;n<r.length;n++){let o=r[n],i=o.trimStart(),a=s;if(s+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let p=o,m=a+o.length,c=Y(o);for(;n+1<r.length&&(c>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
|
|
3
|
+
${u}`,m+=1+u.length,c+=Y(u),s+=u.length+1}let l=St(p);l&&e.push({...l,start:a,end:m})}return e}function St(t){let r=t.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let e=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!e)return null;let s=e[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:e[1],clause:s}}function ht(t,r,e,s){let n=C(s,e.start,e.end),o=e.clause.replace(/\n/g," ").trim();if(e.kind==="import")return x(o).flatMap(p=>{let m=p.trim().replace(/,$/,"");if(!m)return[];let[c,l]=m.split(/\s+as\s+/),u=c.trim(),d=(l??u.split(".")[0]??u).trim(),_=F(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:_,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?F(t,r,e.module):null,a=[];for(let p of x(o)){let m=p.trim().replace(/,$/,"");if(!m)continue;if(m==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[c,l]=m.split(/\s+as\s+/),u=(l??c).trim();a.push({importedName:c.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as xt}from"path";function Ee(t,r,e){return I(t,r,s=>Nt(t,r,s),()=>yt(t,r,e))}function yt(t,r,e){return N(e,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(s,n)=>{let o=s[1],i=s[2];if(!o||!i)return[];let a=o==="require_relative"?V(t,r,i):null;if(a){let p=Te(i);return[$(p,p,a,h(n,p))]}return[D(i,a)]})}function Nt(t,r,e){let s=g(e,new Set([])),n=[],o=new Set(["require","require_relative","load"]);for(let i of e.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let m=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!m||m.type!=="string")continue;let l=m.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?V(t,r,l):null;if(u){let d=Te(l);n.push(f(d,d,u,s))}else n.push(D(l,u))}return n}function Te(t){return xt(t).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function Ce(t,r,e){return I(t,r,s=>It(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?bt(t,r,o,n):[]}))}function It(t,r,e){let s=g(e,new Set(["use_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of J(i,"")){if(!a.importedName||a.importedName==="*")continue;let p=T(t,r,a.qualifiedName)??T(t,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push(f(a.importedName,a.localName,p,s))}}return n}function J(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:B(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:B(r,e),importedName:s,localName:s}]}case"scoped_use_list":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=B(r,e.text),o=[];for(let i of s.namedChildren)o.push(...J(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...J(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=J(e,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let e=t.namedChild(0),s=e?e.text:"";return[{qualifiedName:B(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function B(t,r){return t?r?`${t}::${r}`:t:r}function bt(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let c=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),l=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(l).flatMap(u=>{let d=u.trim();if(!d||d==="self")return[];let[_,A]=d.split(/\s+as\s+/),v=_?.trim();if(!v)return[];let Oe=(A??v.split("::").pop()??v).trim(),ke=`${c}::${v}`.replace(/::::/g,"::");return[P(t,r,s,ke,v.split("::").pop()??v,Oe,T(t,r,c))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),m=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[P(t,r,s,a,a.split("::").pop()??a,p,m)]}function Re(t,r,e){let s=R(t,r);if(s)return Pt(t,r,s);let n=[];for(let o of e.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(...Et(t,r,i))}return n}function Pt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!_t(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of J(o,""))i.importedName&&s.push(G(t,r,i.qualifiedName))}return s}function _t(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Et(t,r,e){let s=e.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),o=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[p]=a.split(/\s+as\s+/),m=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[G(t,r,m)]})}return[G(t,r,s)]}function G(t,r,e){return{specifier:e,sourcePath:T(t,r,e)??T(t,r,e.split("::").slice(0,-1).join("::"))}}function k({language:t,extensions:r,imports:e,parseImports:s}){return{language:t,extensions:r,capabilities:{imports:e},parseImports:s}}function De(t,r){let e=r.toLowerCase();for(let s of t)for(let n of s.extensions)if(e.endsWith(n))return s;return null}var Tt={language:"javascript",extensions:se,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:K,parseReExports:Z},Ct=k({language:"python",extensions:ne,imports:"ast-with-regex-fallback",parseImports:_e}),Rt=k({language:"jvm",extensions:b,imports:"ast-dispatch-with-regex-fallback",parseImports:Ne}),Dt={language:"rust",extensions:oe,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Ce,parseExports:Re},Ot=k({language:"ruby",extensions:ie,imports:"ast-with-regex-fallback",parseImports:Ee}),kt=k({language:"c/cpp",extensions:ae,imports:"ast-with-regex-fallback",parseImports:fe}),At=k({language:"dotnet",extensions:L,imports:"ast-dispatch-with-regex-fallback",parseImports:he}),vt={language:"dart",extensions:pe,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:ge,parseExports:Se},wt=k({language:"php",extensions:U,imports:"ast-with-regex-fallback",parseImports:be}),Lt=[Tt,Ct,Rt,Dt,Ot,kt,At,vt,wt];function z(t){return De(Lt,t)}var ee=w("source-imports"),te=w("source-exports"),re=w("source-reexports");function Yr(t,r){let e=W(r);return re.get(t,e,()=>{let s=z(e);if(!s?.parseReExports)return[];let n=j(t,e);return n?s.parseReExports(t,e,n):[]})}function Kr(t,r){let e=W(r);return ee.get(t,e,()=>{let s=z(e);if(!s)return[];let n=j(t,e);return n?s.parseImports(t,e,n):[]})}function Zr(t,r){let e=W(r);return te.get(t,e,()=>{let s=z(e);if(!s?.parseExports)return[];let n=j(t,e);return n?s.parseExports(t,e,n):[]})}function Gr(t){ee.invalidateAll(t),te.invalidateAll(t),re.invalidateAll(t)}function es(t,r){let e=W(r);ee.invalidate(t,e),te.invalidate(t,e),re.invalidate(t,e)}export{Yr as a,Kr as b,Zr as c,Gr as d,es as e};
|
|
4
|
+
//# sourceMappingURL=chunk-RCJEFQOK.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import{b as _}from"./chunk-QAEDNTY7.js";import{c as u}from"./chunk-NKJKI6SE.js";import{b as l,c as d}from"./chunk-RCJEFQOK.js";import{c as a,e as m}from"./chunk-7OX2O53H.js";import{a as s}from"./chunk-NN3O7TPH.js";function A(e,o={}){let{scope:n,limit:r}=o,t=new _(e),i=h([...b(e,n),...g(e,t,n)]);return y(i),r?i.slice(0,r):i}function b(e,o){let n=[];for(let r of f(e,o)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||u(e,r.barrel_path))continue;let t=R(e,r),i=t?.barrel_consumers??0,c=t?.direct_consumers??0;i!==0||c!==0||n.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:a(r.symbol),originalFile:r.original_path,barrelConsumers:i,directConsumers:c})}return n}function f(e,o){let n=o?`AND barrel_d.relative_path LIKE '%${o}%'`:"";return e.all(`SELECT DISTINCT
|
|
2
|
+
barrel_d.id AS barrel_doc_id,
|
|
3
|
+
barrel_d.relative_path AS barrel_path,
|
|
4
|
+
gs.id AS symbol_id,
|
|
5
|
+
gs.symbol AS symbol,
|
|
6
|
+
orig_d.id AS original_doc_id,
|
|
7
|
+
orig_d.relative_path AS original_path
|
|
8
|
+
FROM mentions m
|
|
9
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
+
JOIN documents barrel_d ON c.document_id = barrel_d.id
|
|
11
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
12
|
+
JOIN (
|
|
13
|
+
SELECT m2.symbol_id, c2.document_id
|
|
14
|
+
FROM mentions m2
|
|
15
|
+
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
16
|
+
WHERE m2.role = 1
|
|
17
|
+
GROUP BY m2.symbol_id
|
|
18
|
+
) sym_def ON sym_def.symbol_id = gs.id
|
|
19
|
+
JOIN documents orig_d ON sym_def.document_id = orig_d.id
|
|
20
|
+
WHERE m.role != 1
|
|
21
|
+
AND (barrel_d.relative_path LIKE '%/index.ts'
|
|
22
|
+
OR barrel_d.relative_path LIKE '%/index.js'
|
|
23
|
+
OR barrel_d.relative_path = 'index.ts'
|
|
24
|
+
OR barrel_d.relative_path = 'index.js')
|
|
25
|
+
AND orig_d.id != barrel_d.id
|
|
26
|
+
${e.pathExclusionsFor("barrel_d","orig_d")}
|
|
27
|
+
${e.symbolNoiseFor("gs")}
|
|
28
|
+
-- Only function-level symbols (ending with ().), not module-level
|
|
29
|
+
AND gs.symbol LIKE '%().'
|
|
30
|
+
${n}
|
|
31
|
+
ORDER BY barrel_d.relative_path, gs.symbol`)}function R(e,o){return e.get(`SELECT
|
|
32
|
+
SUM(CASE WHEN uses_barrel = 1 THEN 1 ELSE 0 END) AS barrel_consumers,
|
|
33
|
+
SUM(CASE WHEN uses_barrel = 0 THEN 1 ELSE 0 END) AS direct_consumers
|
|
34
|
+
FROM (
|
|
35
|
+
SELECT
|
|
36
|
+
consumer_d.id AS consumer_doc_id,
|
|
37
|
+
MAX(CASE WHEN EXISTS (
|
|
38
|
+
SELECT 1
|
|
39
|
+
FROM mentions barrel_m
|
|
40
|
+
JOIN chunks barrel_c ON barrel_m.chunk_id = barrel_c.id
|
|
41
|
+
WHERE barrel_c.document_id = consumer_d.id
|
|
42
|
+
AND barrel_m.role != 1
|
|
43
|
+
AND barrel_m.symbol_id IN (
|
|
44
|
+
SELECT m2.symbol_id
|
|
45
|
+
FROM mentions m2
|
|
46
|
+
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
47
|
+
WHERE c2.document_id = ?
|
|
48
|
+
AND m2.role != 1
|
|
49
|
+
)
|
|
50
|
+
) THEN 1 ELSE 0 END) AS uses_barrel
|
|
51
|
+
FROM mentions ref_m
|
|
52
|
+
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
53
|
+
JOIN documents consumer_d ON ref_c.document_id = consumer_d.id
|
|
54
|
+
WHERE ref_m.symbol_id = ?
|
|
55
|
+
AND ref_m.role != 1
|
|
56
|
+
AND consumer_d.id != ?
|
|
57
|
+
AND consumer_d.id != ?
|
|
58
|
+
${e.pathExclusionsFor("consumer_d")}
|
|
59
|
+
GROUP BY consumer_d.id
|
|
60
|
+
)`,o.barrel_doc_id,o.symbol_id,o.barrel_doc_id,o.original_doc_id)}function g(e,o,n){let r=[];for(let t of E(e,n))p(e,t,t)>0||r.push(...S(e,o,t));return r}function E(e,o){return s(e,{scope:o,includeIgnored:!1}).filter(n=>d(e,n).length>0)}function S(e,o,n){return d(e,n).filter(r=>r.sourcePath&&!e.isIgnored(r.sourcePath)).flatMap(r=>x(e,o,n,r.sourcePath))}function x(e,o,n,r){let t=N(o,r);return t?[{barrelFile:n,symbol:t.symbol,shortName:a(t.symbol),originalFile:r,barrelConsumers:0,directConsumers:p(e,r,n)}]:[]}function p(e,o,n){let r=new Set;for(let t of s(e,{includeIgnored:!1}))if(t!==n)for(let i of l(e,t))i.sourcePath===o&&r.add(t);return r.size}function N(e,o){let n=e.definitionsForFile(o);return n.find(r=>m(r.symbol)==="method")??n[0]??null}function h(e){let o=new Set,n=[];for(let r of e){let t=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;o.has(t)||(o.add(t),n.push(r))}return n}function y(e){e.sort((o,n)=>n.directConsumers-o.directConsumers||o.barrelFile.localeCompare(n.barrelFile)||o.shortName.localeCompare(n.shortName))}export{A as a};
|
|
61
|
+
//# sourceMappingURL=chunk-ROOHENEP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-IODTPF5H.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ROZNBWIF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as i}from"./chunk-MX6F756F.js";import{a,b as m}from"./chunk-ARBZM2NF.js";import{a as r}from"./chunk-ZNUPGRPR.js";import{c as s}from"./chunk-7OX2O53H.js";function h(t,n,c={}){let e=r(t,n);if(!e)return null;let o=c.semantic!==!1,y=m(t,e,{limit:50,semantic:o}),b=i(a(t,e,{limit:50,additive:!0,callableOnly:!0,semantic:o}));return{symbol:e.symbol,shortName:s(e.symbol),callers:y.map(l=>({symbol:l.symbol,shortName:s(l.symbol),file:l.file})),callees:b.map(l=>({symbol:l.symbol,shortName:s(l.symbol),file:l.file}))}}export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-TGK5DFBJ.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import d from"ignore";import{readFileSync as c,existsSync as s}from"fs";import{dirname as l,isAbsolute as g,join as a,relative as u,resolve as v}from"path";function F(r){let e=d(),n=!1,t=b(r);for(let i of t)try{let o=c(i,"utf-8");e.add(o),n=!0}catch{}return n||e.add(h),{isIgnored:i=>f(e,r,i),filter:i=>i.filter(o=>!f(e,r,o))}}function b(r){let e=[],n=a(r,".gitignore");s(n)&&e.push(n);let t=l(r),i=0;for(;t!==l(t)&&i<5;){let o=a(t,".gitignore");if(s(o)&&e.push(o),s(a(t,".git")))break;t=l(t),i++}return e}var h=`
|
|
2
|
+
# Dependencies
|
|
3
|
+
node_modules/
|
|
4
|
+
vendor/
|
|
5
|
+
.bundle/
|
|
6
|
+
|
|
7
|
+
# Build output
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
out/
|
|
11
|
+
target/
|
|
12
|
+
bin/
|
|
13
|
+
obj/
|
|
14
|
+
|
|
15
|
+
# Python
|
|
16
|
+
__pycache__/
|
|
17
|
+
*.pyc
|
|
18
|
+
*.pyo
|
|
19
|
+
.venv/
|
|
20
|
+
venv/
|
|
21
|
+
.env/
|
|
22
|
+
env/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
|
|
25
|
+
# Rust
|
|
26
|
+
target/
|
|
27
|
+
|
|
28
|
+
# Java / Kotlin / Scala
|
|
29
|
+
*.class
|
|
30
|
+
.gradle/
|
|
31
|
+
.mvn/
|
|
32
|
+
|
|
33
|
+
# C# / .NET
|
|
34
|
+
bin/
|
|
35
|
+
obj/
|
|
36
|
+
packages/
|
|
37
|
+
|
|
38
|
+
# Go
|
|
39
|
+
vendor/
|
|
40
|
+
|
|
41
|
+
# Dart
|
|
42
|
+
.dart_tool/
|
|
43
|
+
build/
|
|
44
|
+
|
|
45
|
+
# PHP
|
|
46
|
+
vendor/
|
|
47
|
+
|
|
48
|
+
# IDE / OS
|
|
49
|
+
.idea/
|
|
50
|
+
.vscode/
|
|
51
|
+
*.swp
|
|
52
|
+
*.swo
|
|
53
|
+
.DS_Store
|
|
54
|
+
Thumbs.db
|
|
55
|
+
|
|
56
|
+
# Type definitions (often noise in queries)
|
|
57
|
+
*.d.ts
|
|
58
|
+
`;function f(r,e,n){let t=m(e,n);if(!t)return!1;try{return r.ignores(t)}catch{return!1}}function m(r,e){if(!e||e===".")return null;if(!g(e)&&!e.startsWith(".."))return e.replaceAll("\\","/");let n=g(e)?e:v(r,e),t=u(r,n).replaceAll("\\","/");return!t||t==="."||t.startsWith("..")?null:t}export{F as a};
|
|
59
|
+
//# sourceMappingURL=chunk-TKDJQ2WD.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as D,b as L}from"./chunk-JTXKS5GK.js";import{a as M}from"./chunk-V76FCF5F.js";import{a as C,b as F}from"./chunk-MX6F756F.js";import{b as I}from"./chunk-QAEDNTY7.js";import{a as b}from"./chunk-JB4PUN5S.js";import{c as f,d,j as p,w as g}from"./chunk-7OX2O53H.js";import{basename as c,extname as m}from"path";function q(t,n){let{scope:e,maxLoc:r=15,limit:a=30,scanLimit:o}=n??{},i=new I(t),s=k(i.fileDependencyGraph(e));return M({candidates:()=>x(i,e,r),orderCandidates:F,scanLimit:o,prepare:l=>({callerFileMap:D(i,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>h(t,i,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function h(t,n,e,r){let a=S(t,n,e,r.callerFileMap);if(a.length!==1)return null;let o=a[0],i=y(t,e.symbolId,o);if(!i)return null;let s=v(n,t,o,e.symbol,i);if(s&&p(s.symbol))return null;let l=P(r.callerFileMap,r.reverseFanIn,o,s);return l<=3?null:{symbol:e.symbol,shortName:f(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:C(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?f(s.symbol):c(o),callerFanIn:l}}function x(t,n,e){return t.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0})}function S(t,n,e,r){let a=c(e.relativePath,m(e.relativePath)),o=[...r.get(e.symbolId)??[]].filter(i=>i!==e.relativePath).filter(i=>c(i,m(i))!==a).filter(i=>{let s=n.fileKind(i);return s!=="barrel"&&s!=="entry"&&s!=="test"});return L(t,e,o).realConsumers}function y(t,n,e){return t.get(`SELECT c.start_line, c.end_line
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents d ON c.document_id = d.id
|
|
5
|
+
WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
|
|
6
|
+
LIMIT 1`,n,e)}function v(t,n,e,r,a){let o=t.definitionsForFile(e),i=_(n,e,r,a.start_line,a.end_line);return g(o,i)}function P(t,n,e,r){if(r?.isFunctionLike){let a=[...t.get(r.symbolId)??[]].filter(o=>o!==r.relativePath);if(a.length>0)return a.length}return N(n,e)}function _(t,n,e,r,a){let o=d(e);if(!o)return r;let i=b(t,n).get(o);if(!i||i.length===0)return r;for(let s of i)if(s>=r&&s<=a)return s;return r}function k(t){let n=new Map;for(let[e,r]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of r)n.set(a,(n.get(a)??0)+1)}return n}function N(t,n){let e=t.get(n)??0;if(e>0)return e;let r=c(n,m(n)),a=0;for(let[o,i]of t)o!==n&&c(o,m(o))===r&&i>a&&(a=i);return a}export{q as a};
|
|
7
|
+
//# sourceMappingURL=chunk-TRNAQABL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y}from"./chunk-IODTPF5H.js";function R(D,k={}){let{limit:x=10,scope:M,minDepth:v=3}=k,a=y(D,M),u=new Map,c=[],l=new Map,r=new Map,g=new Set,f=[],h=0;for(let t of a.keys()){if(l.has(t))continue;let n=[],s=(a.get(t)??new Set).values();for(l.set(t,h),r.set(t,h),h+=1,f.push(t),g.add(t),n.push({node:t,iter:s,pendingChild:null});n.length>0;){let e=n[n.length-1];if(e.pendingChild!==null){let d=e.pendingChild;e.pendingChild=null,r.set(e.node,Math.min(r.get(e.node),r.get(d)))}let o=e.iter.next();if(o.done){if(r.get(e.node)===l.get(e.node)){let d=[];for(;;){let p=f.pop();if(g.delete(p),d.push(p),u.set(p,c.length),p===e.node)break}c.push(d)}n.pop();continue}let i=o.value;if(l.has(i))g.has(i)&&r.set(e.node,Math.min(r.get(e.node),l.get(i)));else{l.set(i,h),r.set(i,h),h+=1,f.push(i),g.add(i);let d=(a.get(i)??new Set).values();e.pendingChild=i,n.push({node:i,iter:d,pendingChild:null})}}}let m=new Map,w=new Array(c.length);for(let t=0;t<c.length;t++)w[t]=c[t].length,m.set(t,new Set);for(let[t,n]of a){let s=u.get(t);for(let e of n){let o=u.get(e);o!==s&&m.get(s).add(o)}}let S=new Array(c.length),I=new Array(c.length);for(let t=0;t<c.length;t++){let n=[],s=0;for(let e of m.get(t)){let o=I[e];o>s&&(s=o,n=S[e])}S[t]=[t,...n],I[t]=w[t]+s}function A(t){return S[t]}let F=c.map(t=>[...t].sort()),C=new Set,b=[];for(let t=0;t<c.length;t++){let n=A(t),s=[];for(let o of n)s.push(...F[o]);if(s.length<v)continue;let e=s.join(" ");C.has(e)||(C.add(e),b.push({chain:s,depth:s.length}))}return b.sort((t,n)=>n.depth-t.depth),b.slice(0,x)}export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-U75WH4XG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as a}from"./chunk-QAEDNTY7.js";import{a as i}from"./chunk-ZNUPGRPR.js";import{c as s,e as o,k as m}from"./chunk-7OX2O53H.js";function L(t,l){let r=i(t,l);return r?new a(t).definitionsForFile(r.relativePath).filter(e=>e.symbol!==r.symbol).filter(e=>m(r.symbol,e.symbol)).sort((e,n)=>e.startLine-n.startLine||e.endLine-n.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-V53J46BX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as d}from"./chunk-MX6F756F.js";function u(e){let i=e.orderCandidates?[...e.candidates()].sort(e.orderCandidates):e.candidates(),a=d(i,e.scanLimit),r=e.prepare?.(a)??void 0,t=[];for(let s of a){let n=e.evaluate(s,r);n&&t.push(n)}return e.orderResults&&t.sort(e.orderResults),typeof e.limit=="number"?t.slice(0,e.limit):t}export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-V76FCF5F.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{b as h}from"./chunk-QAEDNTY7.js";import{d as p}from"./chunk-7O4MJYIW.js";import{c as u,f,h as g}from"./chunk-7OX2O53H.js";import{execFileSync as d}from"child_process";function A(e,n={}){let t=b(e,n);return t.note?C(t.note,t.changedFileLines):t.changedFiles.length===0?D(t.changedFileLines):I(t.changedFiles,[S(e,t.changedFiles,t.changedFiles)])}function b(e,n={}){let{base:t="HEAD"}=n;try{let s=F(e.config.projectRoot,t);return{changedFileLines:s,changedFiles:_(e,s),note:s.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],note:"Unable to compute git diff."}}}function S(e,n,t){let s=new h(e),r=new Set(t),a=[],l=new Map,o=n.flatMap(i=>s.definitionsForFile(i)).filter(E).sort((i,m)=>i.relativePath.localeCompare(m.relativePath)||i.startLine-m.startLine),c=p(e,o);for(let i of o)x(e,i,t,r,a,l,c.get(i.symbolId)??new Set);return{changedSymbols:a,consumerEntries:[...l.entries()].map(([i,m])=>({file:i,symbols:[...m].sort()}))}}function I(e,n){let t=new Map,s=n.flatMap(a=>a.changedSymbols);for(let a of n)for(let l of a.consumerEntries){let o=t.get(l.file);o||(o=new Set,t.set(l.file,o));for(let c of l.symbols)o.add(c)}let r=N(t);return{changedFiles:[...e],changedSymbols:s,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:s.length,totalAffectedFiles:r.length}}}function C(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function D(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function F(e,n){let t=d("git",["diff","--name-only",n],{encoding:"utf-8",cwd:e,timeout:1e4}),s=d("git",["diff","--name-only","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4}),r=d("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([t,s,r].flatMap(a=>a.split(`
|
|
2
|
+
`)).map(a=>a.trim()).filter(a=>a.length>0))]}function _(e,n){let t=[];for(let s of n){let r=e.get(`SELECT relative_path FROM documents
|
|
3
|
+
WHERE relative_path LIKE ?
|
|
4
|
+
LIMIT 1`,`%${s}`);r&&!e.isIgnored(r.relative_path)&&t.push(r.relative_path)}return t}function x(e,n,t,s,r,a,l){let o=Math.max(R(e,n.symbolId),l.size);if(!v(n,o))return;let c=u(n.symbol);r.push({symbol:n.symbol,shortName:c,file:n.relativePath,fanIn:o});for(let i of M(e,n.symbolId,t))y(e,s,a,i,c);for(let i of l)y(e,s,a,i,c)}function R(e,n){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS fan_in
|
|
5
|
+
FROM mentions m
|
|
6
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
+
WHERE m.symbol_id = ?
|
|
8
|
+
AND m.role != 1`,n)?.fan_in??0}function M(e,n,t){return t.length===0?[]:e.all(`SELECT DISTINCT ref_d.relative_path
|
|
9
|
+
FROM mentions m
|
|
10
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
11
|
+
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
12
|
+
WHERE m.symbol_id = ?
|
|
13
|
+
AND m.role != 1
|
|
14
|
+
AND ref_d.relative_path NOT IN (${t.map(()=>"?").join(",")})
|
|
15
|
+
${e.pathExclusionsFor("ref_d")}`,n,...t).map(r=>r.relative_path)}function y(e,n,t,s,r){if(e.isIgnored(s)||n.has(s))return;let a=t.get(s);a||(a=new Set,t.set(s,a)),a.add(r)}function N(e){return[...e.entries()].map(([n,t])=>({file:n,consumedSymbols:t.size})).sort((n,t)=>t.consumedSymbols-n.consumedSymbols)}function E(e){return!(g(e.symbol)||e.parentTypeName!==null&&!f(e.symbol))}function v(e,n){return f(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{A as a,b,S as c,I as d};
|
|
16
|
+
//# sourceMappingURL=chunk-VUBQBW7H.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as m}from"./chunk-QAEDNTY7.js";import{a as l}from"./chunk-ZNUPGRPR.js";import{d as o,f as a}from"./chunk-7OX2O53H.js";import{basename as d}from"path";function M(t,c){let n=l(t,c);if(!n)return[];let r=o(n.symbol),s=new m(t).definitionsForFile(n.relativePath).filter(e=>a(e.symbol)),i=s.filter(e=>e.parentTypeName===r||e.symbol.includes(r));return(i.length>0?i:p(d(n.relativePath))===r?s.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:o(e.symbol)}))}function p(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-WJQY2LGT.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as l}from"./chunk-
|
|
1
|
+
import{b as l}from"./chunk-DFK54IRN.js";import{b as a}from"./chunk-QAEDNTY7.js";import{c as i,f as n}from"./chunk-7OX2O53H.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -25,5 +25,5 @@ import{b as l}from"./chunk-LLDPR3DG.js";import{a as n}from"./chunk-LNUZWWWL.js";
|
|
|
25
25
|
AND m.role != 1
|
|
26
26
|
AND ${e.localSymbolPredicate}
|
|
27
27
|
${e.pathExclusionsFor("d1")}
|
|
28
|
-
ORDER BY d1.relative_path`,...r,...r,...r)}function c(e,r){let t=new
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
ORDER BY d1.relative_path`,...r,...r,...r)}function c(e,r){let t=new a(e);return r.flatMap(o=>t.definitionsForFile(o).filter(s=>n(s.symbol)).map(s=>({relative_path:o,symbol:s.symbol})))}function m(e){let r=new Set;return e.filter(t=>{let o=`${t.relative_path}|${t.symbol}`;return r.has(o)?!1:(r.add(o),!0)})}function u(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:i(e.symbol)}}export{_ as a};
|
|
29
|
+
//# sourceMappingURL=chunk-WODJHE6Z.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{b as m}from"./chunk-
|
|
1
|
+
import{b as m}from"./chunk-DFK54IRN.js";import{v as o}from"./chunk-7OX2O53H.js";function h(t,l){let s=m(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
|
|
2
2
|
WHERE relative_path IN (${d})
|
|
3
|
-
ORDER BY relative_path`,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e)),
|
|
3
|
+
ORDER BY relative_path`,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e)),n=o(t,i,{onlyDocumented:!0,sort:!0}).map(({relativePath:e,...c})=>c),a=t.all(`SELECT DISTINCT d2.relative_path
|
|
4
4
|
FROM mentions m
|
|
5
5
|
JOIN chunks c ON m.chunk_id = c.id
|
|
6
6
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -31,5 +31,5 @@ import{b as m}from"./chunk-LLDPR3DG.js";import{I as o}from"./chunk-NLJCXHFU.js";
|
|
|
31
31
|
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
32
32
|
WHERE d2.relative_path IN (${d})
|
|
33
33
|
AND d1.relative_path NOT IN (${d})
|
|
34
|
-
ORDER BY d1.relative_path`,...s,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e));return{files:i,symbols:
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
ORDER BY d1.relative_path`,...s,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e));return{files:i,symbols:n,dependsOn:a,dependedOnBy:r}}export{h as a};
|
|
35
|
+
//# sourceMappingURL=chunk-WPLKHAH7.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as b,c as p}from"./chunk-MX6F756F.js";import{b as g}from"./chunk-QAEDNTY7.js";import{c as d}from"./chunk-7OX2O53H.js";function M(n,l={}){let{scope:e,minLoc:s=10,minCallees:o=6,limit:t=20,scanLimit:i}=l,r=new g(n),c=r.productionCallableDefinitions({scope:e,minLoc:s,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),f=p(c,i),h=r.calleeMap(f,{semantic:l.semantic!==!1}),m=[];for(let a of f){let u=S(a,h.get(a.symbolId)??[],o);u&&m.push(u)}return m.sort((a,u)=>u.clusters.length-a.clusters.length||u.loc-a.loc),m.slice(0,t)}function S(n,l,e){let s=new Set(l.map(r=>r.symbol));if(s.size<e)return null;let o=C(s,l),t=y(s,o);if(t.length<2)return null;let i=x(t,o);return i.length===0?null:{symbol:n.symbol,shortName:d(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:b(n),totalCallees:s.size,clusters:i}}function C(n,l){let e=new Map;for(let o of n)e.set(o,new Set);let s=new Map;for(let o of l){let t=s.get(o.chunkId);t||(t=new Set,s.set(o.chunkId,t)),t.add(o.symbol)}for(let o of s.values()){let t=[...o];for(let i=0;i<t.length;i++)for(let r=i+1;r<t.length;r++)e.get(t[i]).add(t[r]),e.get(t[r]).add(t[i])}return e}function y(n,l){let e=new Set,s=[];for(let o of n){if(e.has(o))continue;let t=new Set,i=[o];for(;i.length>0;){let r=i.pop();if(!e.has(r)){e.add(r),t.add(r);for(let c of l.get(r)??[])e.has(c)||i.push(c)}}s.push(t)}return s}function x(n,l){return n.filter(e=>e.size>=3).map(e=>L(e,n,l)).filter(e=>e.isolation>.5).sort((e,s)=>s.isolation-e.isolation)}function L(n,l,e){let s=new Set;for(let r of l)if(r!==n)for(let c of r)s.add(c);let o=0;for(let r of n)for(let c of e.get(r)??[])s.has(c)&&o++;let t=n.size*s.size,i=t>0?1-o/t:1;return{callees:[...n].map(d),isolation:i}}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-XO6R3X5J.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as f}from"./chunk-MX6F756F.js";import{b}from"./chunk-QAEDNTY7.js";import{a as c,b as u}from"./chunk-ARBZM2NF.js";import{c as l}from"./chunk-7OX2O53H.js";function w(o,e={}){let{limit:r=20,scope:s,minFanIn:i=2,minFanOut:n=2,scanLimit:a}=e,p=new b(o);return f(p.productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),a).map(t=>y(o,t,e.semantic!==!1)).filter(t=>t.fanIn>=i&&t.fanOut>=n).sort((t,m)=>m.score-t.score||m.fanIn-t.fanIn).slice(0,r)}function y(o,e,r){let s=new Set(u(o,e,{limit:500,semantic:r}).map(n=>n.file)).size,i=new Set(c(o,e,{limit:500,semantic:r}).filter(n=>n.file!==e.relativePath).map(n=>`${n.symbol}|${n.file}`)).size;return{symbol:e.symbol,shortName:l(e.symbol),fanIn:s,fanOut:i,score:s*i,definedIn:e.relativePath}}export{w as a};
|
|
2
|
+
//# sourceMappingURL=chunk-YSZNAG4G.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b as D,c as $,d as Q,f as v,g as A,h as N,m as y,n as d,q as w,x as f}from"./chunk-7OX2O53H.js";function re(e,n){let t=Z(e,n.trim());if(t)return t;let i=q(e,n);if(i)return i;let o=F(e,n);return o||j(e,n)}function F(e,n){let t=x(n),i=I(t);if(!i)return null;let o=`%${i.path}%`,r=i.leaf,c=O(e,o,r,t)[0];return c?f(e,c):null}function O(e,n,t,i){let o=w([],[...z(e,n,t),...W(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>h(r,i)>1);return o.sort((r,a)=>h(a,i)-h(r,i)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),o}function z(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function W(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function j(e,n){let t=x(n),i=U(n),o=H(e,i),r=V(o,n,t);if(r&&!e.isIgnored(r.relative_path))return f(e,r);let a=null;for(let c of o){if(e.isIgnored(c.relative_path))continue;let l=J(c,n,t,i);l<=0||(!a||l>a.score)&&(a={row:c,score:l})}return a?f(e,a.row):null}function q(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return null;let[,i,o,r]=t,a=Math.max(0,parseInt(o,10)-1),c=Math.max(a,parseInt(r,10)-1),l=T(e,i,a,c)??X(e,i,a,c);return l&&!e.isIgnored(l.relative_path)?f(e,l):null}function T(e,n,t,i){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function X(e,n,t,i){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function Z(e,n){let i=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line",limit:1})[0]??d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line",limit:1})[0];return!i||e.isIgnored(i.relative_path)?null:f(e,i)}function ae(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=G(e,n.symbolId)[0];return t?f(e,t):null}function G(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),i=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return w(t,i)}function H(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),i=n.flatMap(c=>{let l=`%${c}%`;return[l,l,l]}),o=t.join(`
|
|
2
|
+
AND `),r=y(e,{where:o,params:i,limit:200}),a=d(e,{where:o,params:i,limit:200});return w(r,a)}function J(e,n,t,i){let o=n.trim(),r=t,a=r.replace(/\(\)$/,""),c=n.toLowerCase(),l=t.toLowerCase(),S=l.replace(/\(\)$/,""),k=e.symbol,C=$(e.symbol),b=Q(e.symbol),E=e.display_name??"",g=e.symbol.toLowerCase(),u=C.toLowerCase(),m=b.toLowerCase(),R=E.toLowerCase(),p=e.relative_path.toLowerCase(),K=/[/:.]/.test(t),M=I(t),_=M?.leaf.toLowerCase(),s=0;return(k===o||k===r)&&(s+=1150),(C===o||C===r)&&(s+=1100),E===a&&(s+=1180),b===a&&(s+=1160),(`${b}()`===o||`${b}()`===r)&&(s+=955),(g===c||g===l)&&(s+=1e3),(u===c||u===l)&&(s+=950),(p===c||p===l)&&(s+=925),(p.endsWith(`/${l}`)||p.endsWith(`/${c}`))&&(s+=875),R===S&&(s+=850),m===S&&(s+=825),(`${m}()`===c||`${m}()`===l)&&(s+=820),(u.endsWith(`:${l}`)||u.endsWith(`:${S}`)||u.endsWith(`:${S}()`))&&(s+=800),g.includes(l)&&(s+=120),u.includes(l)&&(s+=140),p.includes(l)&&(s+=140),R.includes(l)&&(s+=110),i.every(B=>{let L=B.toLowerCase();return g.includes(L)||u.includes(L)||p.includes(L)||R.includes(L)})&&(s+=100+i.length*15),M&&p.includes(M.path.toLowerCase())&&(s+=360,_&&(m===_||`${m}()`===_||`${m}()`==`${_}()`)&&(s+=700),v(e.symbol)&&(s+=180)),A(e.symbol)&&m===S&&(s+=60),!K&&N(e.symbol)&&(s-=160),s-=Math.min(50,Math.max(0,e.end_line-e.start_line)),s}function I(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let i=n.slice(t+1).replace(/\(\)$/,"");return!i||i.includes(".")?null:{path:n.slice(0,t),leaf:i}}function x(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function U(e){let n=x(e),t=n.split(/[^A-Za-z0-9_]+/).map(i=>i.trim()).filter(i=>i.length>0);return t.length>0?[...new Set(t)]:[n]}function V(e,n,t){let i=n.trim(),o=e.filter(r=>{let a=$(r.symbol),c=(r.display_name??"").trim();return r.symbol===i||a===i||a===t||c===i||c===t||`${c}()`===i||h(r,t)>1||r.relative_path===i});return o.length===0?null:(o.sort((r,a)=>h(a,t)-h(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),o[0]??null)}function h(e,n){let t=I(n);if(!t)return 0;let i=e.relative_path.toLowerCase(),o=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return i.includes(r)?o!==a?1:v(e.symbol)?D(e.symbol)===null?5:4:D(e.symbol)===null?3:2:0}export{re as a,Z as b,ae as c};
|
|
3
|
+
//# sourceMappingURL=chunk-ZNUPGRPR.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as t}from"./chunk-DFK54IRN.js";function r(e,n,o){let d=t(e,n)??n,s=t(e,o)??o,m=e.get(`SELECT COUNT(DISTINCT gs.id) AS shared
|
|
2
2
|
FROM global_symbols gs
|
|
3
3
|
WHERE (
|
|
4
4
|
-- Defined in file1, referenced in file2
|
|
@@ -30,7 +30,7 @@ import{a as m}from"./chunk-LLDPR3DG.js";function r(e,o,n){let d=m(e,o)??o,s=m(e,
|
|
|
30
30
|
JOIN documents d ON c.document_id = d.id
|
|
31
31
|
WHERE m.symbol_id = gs.id AND m.role != 1 AND d.relative_path = ?
|
|
32
32
|
)
|
|
33
|
-
)`,d,s,s,d);return{file1:d,file2:s,sharedSymbols:
|
|
33
|
+
)`,d,s,s,d);return{file1:d,file2:s,sharedSymbols:m?.shared??0}}function c(e,n={}){let{limit:o=20,scope:d}=n,s=d?`AND d1.relative_path LIKE '%${d}%' AND d2.relative_path LIKE '%${d}%'`:"";return e.all(`SELECT
|
|
34
34
|
def_d.relative_path AS file1,
|
|
35
35
|
ref_d.relative_path AS file2,
|
|
36
36
|
COUNT(DISTINCT gs.id) AS shared
|
|
@@ -52,5 +52,5 @@ import{a as m}from"./chunk-LLDPR3DG.js";function r(e,o,n){let d=m(e,o)??o,s=m(e,
|
|
|
52
52
|
${s}
|
|
53
53
|
GROUP BY def_d.id, ref_d.id
|
|
54
54
|
ORDER BY shared DESC
|
|
55
|
-
LIMIT ?`,
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
LIMIT ?`,o).filter(i=>!e.isIgnored(i.file1)&&!e.isIgnored(i.file2)).map(i=>({file1:i.file1,file2:i.file2,sharedSymbols:i.shared}))}export{r as a,c as b};
|
|
56
|
+
//# sourceMappingURL=chunk-ZXFTC5ET.js.map
|