scip-query 0.10.1 → 0.10.3
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 +2 -2
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-24PFLKFK.js → chunk-3KLLFNT4.js} +2 -2
- package/dist/{chunk-UIWAZ2NT.js → chunk-3UVJJ6Z7.js} +1 -1
- package/dist/chunk-3UW7VM4H.js +62 -0
- package/dist/chunk-3ZYF3ELZ.js +2 -0
- package/dist/{chunk-6YKJSETN.js → chunk-47UA45TU.js} +2 -2
- package/dist/chunk-4HOMAEDD.js +2 -0
- package/dist/{chunk-5VB3WU7K.js → chunk-4ZUJJRWT.js} +2 -2
- package/dist/{chunk-LWPEZ4FP.js → chunk-5FOPAXWY.js} +2 -2
- package/dist/{chunk-CCB45WDY.js → chunk-5M4TYWVI.js} +2 -2
- package/dist/{chunk-PV4CEDIL.js → chunk-5QJXH6ZL.js} +5 -5
- package/dist/{chunk-NN3O7TPH.js → chunk-64MNV6AB.js} +1 -1
- package/dist/{chunk-LWWZBABT.js → chunk-77YBOOYT.js} +2 -2
- package/dist/chunk-7ADUXFRZ.js +2 -0
- package/dist/chunk-7KCSELEV.js +2 -0
- package/dist/{chunk-GZXXBDJA.js → chunk-7OHWPJ5N.js} +2 -2
- package/dist/{chunk-BJ7OHKB5.js → chunk-7S5E7KWT.js} +1 -1
- package/dist/chunk-A3VNUGKJ.js +2 -0
- package/dist/{chunk-CMGOXDVP.js → chunk-A4L36SZS.js} +2 -2
- package/dist/{chunk-5D3BT4B4.js → chunk-AUVBR62P.js} +2 -2
- package/dist/chunk-AW4N6MGC.js +18 -0
- package/dist/{chunk-65UWNXEH.js → chunk-B6MJ5VQV.js} +2 -2
- package/dist/chunk-BKDXBJDQ.js +2 -0
- package/dist/{chunk-WZVTADY7.js → chunk-C2QSK7E7.js} +1 -1
- package/dist/chunk-C3MZZ2ZN.js +2 -0
- package/dist/{chunk-GTNPPGZJ.js → chunk-CAWSSEVM.js} +2 -2
- package/dist/chunk-CFL2CNIF.js +10 -0
- package/dist/{chunk-E55WCTLH.js → chunk-CJJP64OC.js} +2 -2
- package/dist/{chunk-ADKQX2OY.js → chunk-CRU42NJU.js} +2 -2
- package/dist/chunk-CSWZFD46.js +2 -0
- package/dist/{chunk-QOFKVNFE.js → chunk-CTCAF3YA.js} +2 -2
- package/dist/{chunk-YVQUQIBM.js → chunk-D322LMSA.js} +2 -2
- package/dist/{chunk-IJYWCB57.js → chunk-DAI74TJU.js} +2 -2
- package/dist/chunk-DE7MA6OD.js +3 -0
- package/dist/chunk-DJMK4DBL.js +2 -0
- package/dist/{chunk-FVX4GEAC.js → chunk-E44ZMVNA.js} +2 -2
- package/dist/{chunk-MESUJJVQ.js → chunk-E7KERP7E.js} +2 -2
- package/dist/{chunk-YIE5FZAF.js → chunk-EOZIZWW4.js} +2 -2
- package/dist/{chunk-XGGTESMN.js → chunk-ERHOS6AW.js} +2 -2
- package/dist/{chunk-5HDYAOSF.js → chunk-ESG4HBEF.js} +2 -2
- package/dist/{chunk-HCQ7J2N5.js → chunk-EWC3UK4V.js} +3 -3
- package/dist/chunk-EYLXU575.js +2 -0
- package/dist/chunk-FIB4JPEX.js +2 -0
- package/dist/chunk-FNRPGGVI.js +2 -0
- package/dist/{chunk-QUKZ77A6.js → chunk-FOQHUKNZ.js} +2 -2
- package/dist/{chunk-QH5GTVVB.js → chunk-FUPDW5AC.js} +2 -2
- package/dist/{chunk-B3HMRQDA.js → chunk-G3WGZU5Q.js} +2 -2
- package/dist/chunk-GLJAAKDW.js +4 -0
- package/dist/{chunk-TUAPDKBI.js → chunk-GS33KGAY.js} +2 -2
- package/dist/{chunk-623UQCVG.js → chunk-GZCQTZLK.js} +2 -2
- package/dist/{chunk-SA6B3EGD.js → chunk-HVTYSC26.js} +2 -2
- package/dist/chunk-I7TSQZ3J.js +4 -0
- package/dist/{chunk-R7S3UCDR.js → chunk-ICXVNWMI.js} +2 -2
- package/dist/chunk-JM72FNGA.js +2 -0
- package/dist/{chunk-DRU74YUM.js → chunk-KPHKX4LP.js} +1 -1
- package/dist/chunk-KRGBLZT2.js +7 -0
- package/dist/{chunk-YYCQQBMG.js → chunk-LPLGJ4HO.js} +2 -2
- package/dist/chunk-MUULWXSJ.js +2 -0
- package/dist/chunk-MZ7APUFN.js +3 -0
- package/dist/{chunk-LYS4SMAQ.js → chunk-NNDYO2DX.js} +2 -2
- package/dist/{chunk-ATGRITZP.js → chunk-NP5HYVLX.js} +4 -4
- package/dist/{chunk-MHAQXOZY.js → chunk-NVFERV4U.js} +2 -2
- package/dist/{chunk-LWYIGRHR.js → chunk-NXIAHE7F.js} +1 -1
- package/dist/chunk-O3OKSF6O.js +2 -0
- package/dist/chunk-O4L4AB3T.js +2 -0
- package/dist/{chunk-TMS4JPWY.js → chunk-OBBDKQAG.js} +2 -2
- package/dist/chunk-OLD6PBU6.js +7 -0
- package/dist/{chunk-5BZOSICN.js → chunk-PFOCOG57.js} +1 -1
- package/dist/{chunk-CFLYMEUS.js → chunk-PVZMPG5I.js} +1 -1
- package/dist/{chunk-T67R7V5I.js → chunk-QLNGUWR7.js} +2 -2
- package/dist/chunk-QSXQT3NE.js +2 -0
- package/dist/{chunk-6TWFT4Y5.js → chunk-QVCCLDZI.js} +2 -2
- package/dist/{chunk-PNN3D4BE.js → chunk-RHTJBYZ5.js} +2 -2
- package/dist/chunk-SPE4YCOT.js +7 -0
- package/dist/{chunk-4N7LFYSD.js → chunk-TM6GVHA6.js} +2 -2
- package/dist/chunk-TO54DY4O.js +2 -0
- package/dist/{chunk-HQHFMPLJ.js → chunk-UMNENNTX.js} +2 -2
- package/dist/chunk-UQJGTVHV.js +5 -0
- package/dist/{chunk-TKDJQ2WD.js → chunk-UUBMFL3F.js} +1 -1
- package/dist/chunk-VAA5FFIW.js +2 -0
- package/dist/chunk-X474LKJX.js +2 -0
- package/dist/chunk-X7ZY6FFF.js +4 -0
- package/dist/{chunk-RNLUCQJB.js → chunk-YQH353VA.js} +2 -2
- package/dist/{chunk-44JOJLMO.js → chunk-YTR4CO5S.js} +2 -2
- package/dist/chunk-YUOAAR24.js +2 -0
- package/dist/chunk-YVLHL6KQ.js +8 -0
- package/dist/{chunk-ADTG377O.js → chunk-YYD245WG.js} +2 -2
- package/dist/{chunk-I6PTB2CM.js → chunk-Z4VHYJ5U.js} +2 -2
- package/dist/chunk-ZFMPHDAT.js +4 -0
- package/dist/chunk-ZQLO2SCU.js +6 -0
- package/dist/chunk-ZSLT7NWQ.js +61 -0
- package/dist/cli.js +242 -225
- package/dist/{config-types-Bok4jrO3.d.ts → config-types-Bj4sh28g.d.ts} +8 -0
- package/dist/{db-BkFlkzI3.d.ts → db-CTarohbZ.d.ts} +1 -1
- package/dist/git-history-Dao3_Pu9.d.ts +12 -0
- package/dist/{health-CbGMdRPg.d.ts → health-Bx0x1HAG.d.ts} +23 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +6 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +37 -3
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +6 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +10 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +6 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +53 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +2 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +20 -3
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +10 -3
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +11 -3
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +14 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +17 -15
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +51 -0
- package/dist/queries/locality-candidates.js +2 -0
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +8 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +4 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +9 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +9 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +25 -3
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +7 -3
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +24 -3
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +10 -3
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-imports.d.ts +4 -0
- package/dist/queries/unused-imports.js +2 -0
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +9 -3
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +9 -3
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +6 -3
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.d.ts +1 -1
- package/dist/reindex.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -2
- package/docs/COMMAND_REFERENCE.md +3 -2
- package/docs/analyzer-inventory.md +162 -0
- package/docs/analyzer-validation-ledger.md +262 -0
- package/docs/analyzer-validation-protocol.md +192 -0
- package/docs/locality-analyzer-design.md +193 -0
- package/package.json +14 -3
- package/skills/scip-directory-architecture/SKILL.md +178 -0
- package/skills/scip-maintainability/SKILL.md +1 -1
- package/skills/scip-query/SKILL.md +2 -1
- package/skills/scip-query-setup/SKILL.md +118 -0
- package/skills/scip-react-maintainability/SKILL.md +1 -1
- package/skills/scip-vue-maintainability/SKILL.md +1 -1
- package/dist/chunk-23FVN4Y5.js +0 -2
- package/dist/chunk-27KPKLRJ.js +0 -7
- package/dist/chunk-2NLK4INB.js +0 -2
- package/dist/chunk-2XKAMW6B.js +0 -61
- package/dist/chunk-332L7SRO.js +0 -2
- package/dist/chunk-4EAANIWC.js +0 -2
- package/dist/chunk-5ALI77D7.js +0 -3
- package/dist/chunk-5IDEQEM4.js +0 -4
- package/dist/chunk-62NMBOA5.js +0 -2
- package/dist/chunk-64LH2QUP.js +0 -62
- package/dist/chunk-6U4EODW3.js +0 -2
- package/dist/chunk-A2GVUCZR.js +0 -8
- package/dist/chunk-DBIG4QAJ.js +0 -2
- package/dist/chunk-DMLPJ75B.js +0 -2
- package/dist/chunk-DTERBKUE.js +0 -7
- package/dist/chunk-F4PKYBQB.js +0 -2
- package/dist/chunk-JTRY2YRJ.js +0 -2
- package/dist/chunk-L77GXANO.js +0 -6
- package/dist/chunk-LT6GJ27X.js +0 -10
- package/dist/chunk-LUBKUISI.js +0 -2
- package/dist/chunk-LVYXX7ZW.js +0 -2
- package/dist/chunk-LXM7AHQG.js +0 -4
- package/dist/chunk-LY6NRJPJ.js +0 -2
- package/dist/chunk-N2T2GPYQ.js +0 -2
- package/dist/chunk-OB6PEVI3.js +0 -2
- package/dist/chunk-R42LZMLX.js +0 -2
- package/dist/chunk-RGDUIMNE.js +0 -3
- package/dist/chunk-RYBMW2EN.js +0 -2
- package/dist/chunk-TTGWDUJ4.js +0 -5
- package/dist/chunk-UVK3SL4Z.js +0 -2
- package/dist/chunk-W3PQRAI4.js +0 -2
- package/dist/chunk-WWFBDM5Y.js +0 -2
- package/dist/chunk-Y33GRQK6.js +0 -18
- package/dist/chunk-YISMWW66.js +0 -7
package/dist/queries/system.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-ICXVNWMI.js";import"../chunk-CTCAF3YA.js";import"../chunk-MZ7APUFN.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as system};
|
|
2
2
|
//# sourceMappingURL=system.js.map
|
package/dist/queries/trace.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
5
|
interface TraceResult {
|
|
6
6
|
definitions: Array<{
|
package/dist/queries/trace.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-X7ZY6FFF.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as trace};
|
|
2
2
|
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c}from"../chunk-7OHWPJ5N.js";import"../chunk-CTCAF3YA.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as importedBy,a as imports,c as unusedImports};
|
|
2
|
+
//# sourceMappingURL=unused-imports.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
5
|
interface UnusedParamsFinding {
|
|
6
6
|
symbol: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-NNDYO2DX.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as unusedParams};
|
|
2
2
|
//# sourceMappingURL=unused-params.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
5
|
interface VueComponentDuplicateResult {
|
|
6
6
|
fileA: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-GS33KGAY.js";import"../chunk-PVZMPG5I.js";import"../chunk-3UVJJ6Z7.js";import"../chunk-ERHOS6AW.js";import"../chunk-D322LMSA.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComponentDuplicates};
|
|
2
2
|
//# sourceMappingURL=vue-component-duplicates.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
|
+
type VueComposableEvidenceClass = 'domain-behavior' | 'generic-workflow-scaffolding' | 'mixed' | 'shared-abstraction';
|
|
6
|
+
type VueComposableActionTier = 'signal' | 'support';
|
|
5
7
|
interface VueComposableCandidateResult {
|
|
6
8
|
fileA: string;
|
|
7
9
|
fileB: string;
|
|
@@ -16,6 +18,10 @@ interface VueComposableCandidateResult {
|
|
|
16
18
|
sharedFunctionVerbs: string[];
|
|
17
19
|
sharedBindings: string[];
|
|
18
20
|
sharedTemplateEvents: string[];
|
|
21
|
+
evidenceClass: VueComposableEvidenceClass;
|
|
22
|
+
actionTier: VueComposableActionTier;
|
|
23
|
+
evidenceClassReasons: string[];
|
|
24
|
+
recommendation: string;
|
|
19
25
|
uniqueToA: string[];
|
|
20
26
|
uniqueToB: string[];
|
|
21
27
|
reason: string;
|
|
@@ -31,4 +37,4 @@ declare function vueComposableCandidates(db: ScipDatabase, opts?: {
|
|
|
31
37
|
filePattern?: string;
|
|
32
38
|
}): VueComposableCandidateResult[];
|
|
33
39
|
|
|
34
|
-
export { type VueComposableCandidateResult, vueComposableCandidates };
|
|
40
|
+
export { type VueComposableActionTier, type VueComposableCandidateResult, type VueComposableEvidenceClass, vueComposableCandidates };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-O4L4AB3T.js";import"../chunk-PVZMPG5I.js";import"../chunk-3UVJJ6Z7.js";import"../chunk-ERHOS6AW.js";import"../chunk-D322LMSA.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComposableCandidates};
|
|
2
2
|
//# sourceMappingURL=vue-composable-candidates.js.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
5
|
type VueLargeViewPressureAxis = 'template' | 'script' | 'style' | 'external-script' | 'custom-block' | 'total';
|
|
6
|
+
type VueLargeViewContextKind = 'component' | 'route-page';
|
|
7
|
+
type VueLargeViewRecommendationKind = 'custom-block-review' | 'external-script-boundary' | 'route-page-decomposition' | 'script-behavior-extraction' | 'style-decomposition' | 'template-decomposition' | 'total-size-review';
|
|
6
8
|
interface VueLargeViewPressureResult {
|
|
7
9
|
file: string;
|
|
8
10
|
totalLines: number;
|
|
@@ -14,6 +16,10 @@ interface VueLargeViewPressureResult {
|
|
|
14
16
|
externalScriptPaths: string[];
|
|
15
17
|
customBlockLines: number;
|
|
16
18
|
dominantPressure: VueLargeViewPressureAxis;
|
|
19
|
+
pressureKinds: VueLargeViewPressureAxis[];
|
|
20
|
+
contextKind: VueLargeViewContextKind;
|
|
21
|
+
recommendationKind: VueLargeViewRecommendationKind;
|
|
22
|
+
recommendation: string;
|
|
17
23
|
reasons: string[];
|
|
18
24
|
loc: number;
|
|
19
25
|
}
|
|
@@ -28,4 +34,4 @@ declare function vueLargeViewPressure(db: ScipDatabase, opts?: {
|
|
|
28
34
|
filePattern?: string;
|
|
29
35
|
}): VueLargeViewPressureResult[];
|
|
30
36
|
|
|
31
|
-
export { type VueLargeViewPressureAxis, type VueLargeViewPressureResult, vueLargeViewPressure };
|
|
37
|
+
export { type VueLargeViewContextKind, type VueLargeViewPressureAxis, type VueLargeViewPressureResult, type VueLargeViewRecommendationKind, vueLargeViewPressure };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-O3OKSF6O.js";import"../chunk-ERHOS6AW.js";import"../chunk-D322LMSA.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueLargeViewPressure};
|
|
2
2
|
//# sourceMappingURL=vue-large-view-pressure.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
|
+
type WrapperActionTier = 'direct' | 'signal';
|
|
5
6
|
interface WrapperCandidate {
|
|
6
7
|
symbol: string;
|
|
7
8
|
shortName: string;
|
|
@@ -12,6 +13,8 @@ interface WrapperCandidate {
|
|
|
12
13
|
singleCaller: string;
|
|
13
14
|
singleCallerShort: string;
|
|
14
15
|
callerFanIn: number;
|
|
16
|
+
actionTier: WrapperActionTier;
|
|
17
|
+
boundaryEvidence: string[];
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
20
|
* Find wrapper candidates: symbols called by only one other symbol.
|
|
@@ -28,4 +31,4 @@ declare function wrapperCandidates(db: ScipDatabase, opts?: {
|
|
|
28
31
|
semantic?: boolean;
|
|
29
32
|
}): WrapperCandidate[];
|
|
30
33
|
|
|
31
|
-
export { type WrapperCandidate, wrapperCandidates };
|
|
34
|
+
export { type WrapperActionTier, type WrapperCandidate, wrapperCandidates };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-SPE4YCOT.js";import"../chunk-RHTJBYZ5.js";import"../chunk-VAA5FFIW.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as wrapperCandidates};
|
|
2
2
|
//# sourceMappingURL=wrapper-candidates.js.map
|
package/dist/reindex-worker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as v,b as I}from"./chunk-
|
|
1
|
+
import{a as v,b as I}from"./chunk-KPHKX4LP.js";import{a as m,e as A}from"./chunk-NXIAHE7F.js";import{execFileSync as gn}from"child_process";import{closeSync as dn,copyFileSync as mn,existsSync as P,mkdirSync as B,mkdtempSync as fn,openSync as hn,readFileSync as ie,renameSync as M,rmSync as N,writeFileSync as se}from"fs";import{basename as S,dirname as d,extname as xn,join as g}from"path";import{execFileSync as fe}from"child_process";import{existsSync as he,readdirSync as T}from"fs";import{extname as U,join as W}from"path";var xe=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),ye=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function q(e){let n=[],t=be(e),r=Ie(e);for(let a of ye){if(Se(e,a.files)){n.push(a.language);continue}if(Pe(t,a.globs)){n.push(a.language);continue}ke(r,a.extensions)&&n.push(a.language)}return n.includes("typescript")&&_(n,"javascript"),n.includes("cpp")&&!r.has(".c")&&_(n,"c"),n}function be(e){try{return T(e)}catch{return[]}}function Se(e,n){return n?.length?n.some(t=>he(W(e,t))):!1}function Pe(e,n){return n?.length?e.some(t=>n.some(r=>ve(t,r))):!1}function ve(e,n){if(n==="*")return!0;if(!n.includes("*"))return e===n;let[t,r]=n.split("*");return e.startsWith(t??"")&&e.endsWith(r??"")}function Ie(e){let n=Re(e);if(n)return n;let t=new Set,r=[e];for(;r.length>0;){let a=r.pop();if(!a)continue;let i;try{i=T(a,{withFileTypes:!0})}catch{continue}for(let s of i){if(s.name.startsWith(".")&&!s.name.endsWith("proj")&&!s.name.endsWith("sln")&&s.isDirectory())continue;let o=W(a,s.name);if(s.isDirectory()){xe.has(s.name)||r.push(o);continue}let p=U(s.name).toLowerCase();p&&t.add(p)}}return t}function Re(e){try{let n=fe("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),t=new Set;for(let r of n.split(`
|
|
2
2
|
`)){if(!r)continue;let a=U(r).toLowerCase();a&&t.add(a)}return t}catch{return null}}function ke(e,n){return n?.length?n.some(t=>e.has(t)):!1}function _(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as z,readdirSync as De}from"fs";import{join as R}from"path";var Oe={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:n,indexerBinary:t})=>{let r=["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return n&&r.splice(1,0,"--pnpm-workspaces"),{binary:t,args:r}},markerFiles:["tsconfig.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},javascript:{language:"javascript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--infer-tsconfig","--output",e,"--no-progress-bar"]}),markerFiles:["package.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},java:{language:"java",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["pom.xml","build.gradle"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},scala:{language:"scala",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.sbt"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},kotlin:{language:"kotlin",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.gradle.kts"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},rust:{language:"rust",indexerBinary:"rust-analyzer",checkCommand:"rust-analyzer --version",indexArgs:({outputPath:e})=>({binary:"rust-analyzer",args:["scip",".","--output",e]}),markerFiles:["Cargo.toml"],installMethods:[{label:"rustup",prerequisite:"rustup",binary:"rustup",args:["component","add","rust-analyzer"]}],installUrl:"https://github.com/rust-lang/rust-analyzer"},python:{language:"python",indexerBinary:"scip-python-plus",binaryAliases:["scip-python"],checkCommand:"scip-python-plus --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--output",e,"--project-name","project"]}),markerFiles:["pyproject.toml","setup.py"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-python-plus"]}],installUrl:"https://github.com/PlunderStruck/scip-python",bundledNpmPackage:"scip-python-plus"},ruby:{language:"ruby",indexerBinary:"scip-ruby",checkCommand:"scip-ruby --version",indexArgs:({indexerBinary:e})=>({binary:e,args:["--dir","."]}),defaultOutputPath:"index.scip",markerFiles:["Gemfile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-ruby/releases"},go:{language:"go",indexerBinary:"scip-go",checkCommand:"scip-go --version",indexArgs:({outputPath:e})=>({binary:"scip-go",args:["--output",e]}),markerFiles:["go.mod"],installMethods:[{label:"go install",prerequisite:"go",binary:"go",args:["install","github.com/sourcegraph/scip-go@latest"]}],installUrl:"https://github.com/sourcegraph/scip-go"},cpp:{language:"cpp",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},c:{language:"c",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},csharp:{language:"csharp",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",J(e,[".sln",".csproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.csproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},vb:{language:"vb",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",J(e,[".sln",".vbproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.vbproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},dart:{language:"dart",indexerBinary:"scip-dart",checkCommand:"scip-dart --version",indexArgs:({indexerBinary:e,outputPath:n})=>({binary:e,args:["--output",n]}),markerFiles:["pubspec.yaml"],installMethods:[{label:"dart pub",prerequisite:"dart",binary:"dart",args:["pub","global","activate","scip_dart"]}],installUrl:"https://github.com/Workiva/scip-dart/releases"},php:{language:"php",indexerBinary:"scip-php",projectLocalBinaries:["vendor/davidrjenni/scip-php/bin/scip-php","vendor/bin/scip-php"],checkCommand:"scip-php --version",indexArgs:({projectRoot:e,indexerBinary:n})=>{let t=R(e,"vendor","bin","scip-php"),r=R(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",z(r)?r:z(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function k(e){return Oe[e]}function J(e,n){let t;try{t=De(e)}catch{return null}for(let r of t)if(n.some(a=>r.endsWith(a)))return R(e,r);return null}import{readFileSync as Le,writeFileSync as je}from"fs";import{create as D}from"@bufbuild/protobuf";import{deserializeSCIP as Ce,serializeSCIP as we,DocumentSchema as Ee,IndexSchema as $e,SymbolInformationSchema as Fe}from"@c4312/scip";function Be(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let n=Me(e),t=Ne(e.flatMap(a=>a.documents??[])),r=H(e.flatMap(a=>a.externalSymbols??[]));return D($e,{metadata:n,documents:t,externalSymbols:r})}function G(e,n){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let t=e.map(a=>Ce(Le(a))),r=Be(t);return je(n,Buffer.from(we(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function Me(e){let n=e[0]?.metadata;if(!n)return;let t=n.projectRoot;for(let r of e.slice(1)){let a=r.metadata?.projectRoot;if(t&&a&&a!==t)throw new Error(`Cannot merge SCIP indexes with different project roots: ${t} vs ${a}`)}return n}function Ne(e){let n=new Map;for(let t of e){let r=n.get(t.relativePath);if(!r){n.set(t.relativePath,t);continue}n.set(t.relativePath,D(Ee,{language:r.language||t.language,relativePath:r.relativePath||t.relativePath,occurrences:[...r.occurrences,...t.occurrences],symbols:H([...r.symbols,...t.symbols]),text:_e(r.text,t.text),positionEncoding:r.positionEncoding||t.positionEncoding}))}return[...n.values()]}function H(e){let n=new Map;for(let t of e){let r=n.get(t.symbol);if(!r){n.set(t.symbol,t);continue}n.set(t.symbol,D(Fe,{symbol:r.symbol,documentation:Te([...r.documentation,...t.documentation]),relationships:Ae([...r.relationships,...t.relationships]),kind:r.kind||t.kind,displayName:r.displayName||t.displayName,enclosingSymbol:r.enclosingSymbol||t.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??t.signatureDocumentation}))}return[...n.values()]}function Ae(e){let n=new Set,t=[];for(let r of e){let a=[r.symbol,r.isReference?"1":"0",r.isImplementation?"1":"0",r.isTypeDefinition?"1":"0",r.isDefinition?"1":"0"].join("|");n.has(a)||(n.add(a),t.push(r))}return t}function _e(e,n){return e?n?e.length>=n.length?e:n:e:n}function Te(e){return[...new Set(e)]}import{readFileSync as Ue,writeFileSync as We}from"fs";import{create as X}from"@bufbuild/protobuf";import{deserializeSCIP as qe,DocumentSchema as ze,IndexSchema as Je,serializeSCIP as Ge,SymbolRole as He}from"@c4312/scip";function Q(e){let n;try{n=qe(Ue(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let t=Xe(n);return t.removedDefinitionOccurrences>0&&We(e,Buffer.from(Ge(t.index))),{removedDefinitionOccurrences:t.removedDefinitionOccurrences,touchedDocuments:t.touchedDocuments}}function Xe(e){let n=new Set;for(let i of e.documents)for(let s of i.symbols)s.symbol&&n.add(s.symbol);for(let i of e.externalSymbols)i.symbol&&n.add(i.symbol);let t=0,r=0,a=[];for(let i of e.documents){let s=i.occurrences.filter(o=>(o.symbolRoles&He.Definition)===0||n.has(o.symbol)?!0:(t+=1,!1));if(s.length===i.occurrences.length){a.push(i);continue}r+=1,a.push(X(ze,{language:i.language,relativePath:i.relativePath,occurrences:s,symbols:i.symbols,text:i.text,positionEncoding:i.positionEncoding}))}return{index:t===0?e:X(Je,{metadata:e.metadata,documents:a,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:t,touchedDocuments:r}}import{execFile as Qe}from"child_process";import{existsSync as x,renameSync as L,rmSync as j}from"fs";import{cpus as Ke}from"os";import{join as K}from"path";function Ve(e,n,t){if(!e.defaultOutputPath)return;let r=K(n,e.defaultOutputPath);t!==r&&x(r)&&L(r,t)}function Ye(e,n,t){if(!e.defaultOutputPath)return null;let r=K(n,e.defaultOutputPath);if(r===t)return null;let a=`${t}.default-output-backup`;return j(a,{force:!0}),x(r)?(L(r,a),{defaultOutputPath:r,backupPath:a}):{defaultOutputPath:r,backupPath:null}}function Ze(e){e&&(j(e.defaultOutputPath,{force:!0}),e.backupPath&&x(e.backupPath)&&L(e.backupPath,e.defaultOutputPath))}function en(e,n){if(e<=1)return 1;let t=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(n)&&n&&n>0?n:Number.isFinite(t)&&t>0?t:Math.min(2,Math.max(1,Ke().length-1));return Math.max(1,Math.min(e,Math.floor(r)))}async function V(e,n,t,r){let a=e.filter(u=>u.config.defaultOutputPath),i=e.filter(u=>!u.config.defaultOutputPath),s=[],o=en(i.length,r),p=await tn(i,o,u=>O(u,n,t));if(o>1){let u=new Map;for(let c of p.filter(l=>l.skipped)){let l=i.find(h=>h.language===c.language);l&&(t(`Retrying ${l.language} indexer serially after parallel failure...`),u.set(l.language,await O(l,n,t)))}s.push(...p.map(c=>u.get(c.language)??c))}else s.push(...p);for(let u of a)s.push(await O(u,n,t));return s.sort((u,c)=>e.findIndex(l=>l.language===u.language)-e.findIndex(l=>l.language===c.language))}async function O(e,n,t){t(`Indexing ${e.language} with ${e.resolvedBinary}...`),j(e.scipPath,{force:!0});let r=Ye(e.config,n,e.scipPath);try{await nn(e.binary,e.args,{cwd:n,env:e.env,maxBuffer:50*1024*1024}),Ve(e.config,n,e.scipPath)}catch(a){let i=a instanceof Error?a.message:String(a),s=`${e.resolvedBinary} indexer failed: ${i.split(`
|
|
3
3
|
`)[0]}`;return t(`Skipping ${e.language}: ${s}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:s}}}finally{Ze(r)}if(!x(e.scipPath)){let a=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`;return t(`Skipping ${e.language}: ${a}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:a}}}return{language:e.language,scipPath:e.scipPath}}function nn(e,n,t){return new Promise((r,a)=>{Qe(e,[...n],t,i=>{i?a(i):r()})})}async function tn(e,n,t){if(e.length===0)return[];let r=new Array(e.length),a=0,i=Math.max(1,Math.min(e.length,n)),s=Array.from({length:i},async()=>{for(;a<e.length;){let o=a++;r[o]=await t(e[o])}});return await Promise.all(s),r}import{execFileSync as w}from"child_process";import{existsSync as C,readFileSync as rn}from"fs";import{createRequire as an}from"module";import{platform as sn}from"os";import{dirname as Y,join as y}from"path";var on=an(import.meta.url);function E(e){return[e.indexerBinary,...e.binaryAliases??[]]}function $(e){let n=E(e);return n.length===1?n[0]:n.join(" or ")}function b(e){for(let n of E(e))if(m(n))return n;return ln(e)}function Z(e){return b(e)!==null||un(e)}function un(e){return ee(e)!==null}function ln(e){let n=ee(e);if(!n)return null;let r=JSON.parse(rn(n,"utf8")).bin;if(!r)return null;if(typeof r=="string")return y(Y(n),r);for(let a of E(e)){let i=r[a];if(i)return y(Y(n),i)}return null}function ee(e){if(!e.bundledNpmPackage)return null;try{return on.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function ne(e,n){for(let t of e.projectLocalBinaries??[]){let r=y(n,t);if(C(r))return r}return null}function te(e,n=process.env,t=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||ae(t,n))return n;let r=pn(t,n);return r?{...n,DOTNET_ROOT:r}:n}function re(e,n){let t=e.installMethods,r=$(e);if(!t?.length)return n(`No auto-install method available for ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1;for(let a of t)if(m(a.prerequisite)){n(`Installing ${r} via ${a.label}...`);try{w(a.binary,a.args,{stdio:"inherit",timeout:3e5,env:process.env});let i=b(e);if(i){let s=i===e.indexerBinary?"":` (using ${i})`;return n(`Successfully installed ${r} via ${a.label}${s}`),!0}n(`${a.label} command completed but ${r} was not found on PATH`)}catch(i){let s=i instanceof Error?i.message:String(i);n(`${a.label} install failed: ${s}`)}}return n(`Could not auto-install ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1}function pn(e,n){for(let t of cn(n))if(ae(e,{...n,DOTNET_ROOT:t}))return t;return null}function cn(e){let n=[],t=e.DOTNET_ROOT;if(t&&C(t)&&n.push(t),sn()==="darwin"&&m("brew"))try{let r=w("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),a=y(r,"libexec");C(a)&&!n.includes(a)&&n.push(a)}catch{}return n}function ae(e,n){try{return w(e,["--version"],{stdio:"pipe",env:n}),!0}catch{return!1}}async function oe(e){let{projectRoot:n,maxHeapMb:t=8192,onStatus:r=console.log,skipAutoInstall:a=!1}=e,i=yn(e),s=Date.now();B(d(i.outputScip),{recursive:!0}),B(d(i.outputDb),{recursive:!0});let o=e.languages??q(n);if(o.length===0)throw new Error("No supported languages detected in this project. Looked for: tsconfig.json, Cargo.toml, go.mod, pyproject.toml, etc.");r(`Detected languages: ${o.join(", ")}`);let p=Mn(n,o,{pnpmWorkspaces:e.pnpmWorkspaces}),u=Fn(g(d(i.outputDb),"index.lock")),c=null;try{let l=bn({opts:e,paths:i,languages:o,fingerprint:p,start:s,onStatus:r});if(l)return l;Dn(a,r);let h=Sn(i);return c=h.runDir,await Pn({opts:e,languages:o,projectRoot:n,paths:i,tempPaths:h,fingerprint:p,start:s,maxHeapMb:t,skipAutoInstall:a,onStatus:r})}finally{c&&N(c,{recursive:!0,force:!0}),u()}}function yn(e){let n=e.outputScip??g(e.projectRoot,"index.scip"),t=e.outputDb??g(e.projectRoot,"index.db");return{outputScip:n,outputDb:t,metaPath:g(d(t),"meta.json")}}function bn(e){if(e.opts.skipIfUnchanged===!1||!P(e.paths.outputScip)||!P(e.paths.outputDb)||!Nn(e.paths.metaPath,e.fingerprint))return null;v({projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let n=Date.now()-e.start;return e.onStatus(`Index unchanged; reused existing SQLite index in ${(n/1e3).toFixed(1)}s`),{languages:e.languages,indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:n,reused:!0,skipped:[]}}function Sn(e){let n=fn(g(d(e.outputDb),"reindex-"));return{runDir:n,tempOutputScip:g(n,S(e.outputScip)),tempOutputDb:g(n,S(e.outputDb)),tempMetaPath:g(n,S(e.metaPath))}}async function Pn(e){let n={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:t,skippedLanguages:r,reusedLanguages:a}=await vn(e,n);a.length>0&&e.onStatus(`Reused ${a.length} cached language shard(s): ${a.join(", ")}`),In(e,n,t,r);let i=Date.now()-e.start;return e.onStatus(`Done in ${(i/1e3).toFixed(1)}s`),{languages:t.map(s=>s.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:i,reused:!1,skipped:r}}async function vn(e,n){let t=Rn(e),r=new Set(t.map(u=>u.language));for(let u of r)e.onStatus(`Reusing cached ${u} SCIP shard (language inputs unchanged).`);let{preparedRuns:a,skippedLanguages:i}=On({languages:e.languages.filter(u=>!r.has(u)),tempOutputScip:e.tempPaths.tempOutputScip,projectRoot:e.projectRoot,env:n,skipAutoInstall:e.skipAutoInstall,pnpmWorkspaces:e.opts.pnpmWorkspaces,onStatus:e.onStatus}),s=await V(a,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:o}=jn(s,i),p=[...t,...o];return Cn(p,i,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:p,skippedLanguages:i,reusedLanguages:[...r]}}function In(e,n,t,r){kn(e.paths.outputDb,t),wn(t,e.tempPaths.tempOutputScip,e.onStatus),En(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,n,e.onStatus),v({projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus}),An(e.tempPaths.tempMetaPath,{version:3,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,languageFingerprints:ue(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces}),requestedLanguages:e.languages,indexedLanguages:t.map(a=>a.language),skipped:[...r]}),Bn({tempOutputScip:e.tempPaths.tempOutputScip,tempOutputDb:e.tempPaths.tempOutputDb,tempMetaPath:e.tempPaths.tempMetaPath,outputScip:e.paths.outputScip,outputDb:e.paths.outputDb,metaPath:e.paths.metaPath})}function Rn(e){let n;try{n=JSON.parse(ie(e.paths.metaPath,"utf-8"))}catch{return[]}if(n.version!==3||!n.languageFingerprints)return[];let t=[],r=ue(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces});for(let a of e.languages){let i=le(e.paths.outputDb,a);P(i)&&f(n.languageFingerprints[a])===f(r[a])&&t.push({language:a,scipPath:i})}return t}function kn(e,n){for(let t of n){let r=le(e,t.language);B(d(r),{recursive:!0}),t.scipPath!==r&&mn(t.scipPath,r)}}function Dn(e,n){if(!m("scip")){if(e)throw new Error(`The scip CLI is required but not found on PATH.
|
|
4
4
|
Install from: https://github.com/sourcegraph/scip/releases`);if(n("scip CLI not found on PATH. Attempting auto-install..."),!A(n))throw new Error(`The scip CLI is required but could not be installed.
|
package/dist/reindex.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SupportedLanguage, I as IndexerConfig } from './config-types-
|
|
1
|
+
import { a as SupportedLanguage, I as IndexerConfig } from './config-types-Bj4sh28g.js';
|
|
2
2
|
import { Index } from '@c4312/scip';
|
|
3
3
|
export { t as tryInstallScipCli } from './scip-cli-a-xOztiK.js';
|
|
4
4
|
|
package/dist/reindex.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,e as O}from"./chunk-
|
|
1
|
+
import{a as h,e as O}from"./chunk-NXIAHE7F.js";import{a as ee}from"./chunk-UUBMFL3F.js";import{a as Q,b as Z}from"./chunk-OBBDKQAG.js";import"./chunk-64MNV6AB.js";import"./chunk-7S5E7KWT.js";import{execFileSync as ar}from"child_process";import{closeSync as ur,copyFileSync as cr,existsSync as w,mkdirSync as X,mkdtempSync as lr,openSync as gr,readFileSync as Ue,renameSync as K,rmSync as Y,writeFileSync as We}from"fs";import{basename as C,dirname as f,extname as pr,join as d}from"path";import ze from"better-sqlite3";import{execFileSync as qe}from"child_process";import{existsSync as Xe,readdirSync as Ke,readFileSync as Ye}from"fs";import{extname as v,join as ne}from"path";function y(e){let n=new Set((e.extensions??Q).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!Xe(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let t=ee(e.projectRoot),r=Qe(e.projectRoot,n).filter(i=>!t.isIgnored(i)),o=new ze(e.dbPath);try{let i=en(o,r),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
2
2
|
VALUES (?, ?, NULL, ?)`),u=o.transaction(g=>{let l=0;for(let p of g){if(i.has(p))continue;let m=Ye(ne(e.projectRoot,p),"utf-8"),He=s.run(nn(p),p,m);l+=Number(He.changes)}return l})(r),c={scanned:r.length,inserted:u,existing:r.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function Qe(e,n){let t=Ze(e,n);if(t)return t;let r=[],o=i=>{let s=i?ne(e,i):e,a;try{a=Ke(s,{withFileTypes:!0})}catch{return}for(let u of a){if(Z.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(v(u.name).toLowerCase())&&r.push(c)}};return o(""),r.sort()}function Ze(e,n){try{return qe("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
3
|
`).filter(r=>r&&n.has(v(r).toLowerCase())).sort()}catch{return null}}function en(e,n){let t=new Set,r=500;for(let o=0;o<n.length;o+=r){let i=n.slice(o,o+r),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)t.add(a.relative_path)}return t}function nn(e){return v(e).toLowerCase()===".vue"?"vue":v(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as tn}from"child_process";import{existsSync as rn,readdirSync as re}from"fs";import{extname as oe,join as ie}from"path";var on=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),sn=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function F(e){let n=[],t=an(e),r=gn(e);for(let o of sn){if(un(e,o.files)){n.push(o.language);continue}if(cn(t,o.globs)){n.push(o.language);continue}dn(r,o.extensions)&&n.push(o.language)}return n.includes("typescript")&&te(n,"javascript"),n.includes("cpp")&&!r.has(".c")&&te(n,"c"),n}function an(e){try{return re(e)}catch{return[]}}function un(e,n){return n?.length?n.some(t=>rn(ie(e,t))):!1}function cn(e,n){return n?.length?e.some(t=>n.some(r=>ln(t,r))):!1}function ln(e,n){if(n==="*")return!0;if(!n.includes("*"))return e===n;let[t,r]=n.split("*");return e.startsWith(t??"")&&e.endsWith(r??"")}function gn(e){let n=pn(e);if(n)return n;let t=new Set,r=[e];for(;r.length>0;){let o=r.pop();if(!o)continue;let i;try{i=re(o,{withFileTypes:!0})}catch{continue}for(let s of i){if(s.name.startsWith(".")&&!s.name.endsWith("proj")&&!s.name.endsWith("sln")&&s.isDirectory())continue;let a=ie(o,s.name);if(s.isDirectory()){on.has(s.name)||r.push(a);continue}let u=oe(s.name).toLowerCase();u&&t.add(u)}}return t}function pn(e){try{let n=tn("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),t=new Set;for(let r of n.split(`
|
|
4
4
|
`)){if(!r)continue;let o=oe(r).toLowerCase();o&&t.add(o)}return t}catch{return null}}function dn(e,n){return n?.length?n.some(t=>e.has(t)):!1}function te(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as se,readdirSync as mn}from"fs";import{join as D}from"path";var ue={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:n,indexerBinary:t})=>{let r=["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return n&&r.splice(1,0,"--pnpm-workspaces"),{binary:t,args:r}},markerFiles:["tsconfig.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},javascript:{language:"javascript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--infer-tsconfig","--output",e,"--no-progress-bar"]}),markerFiles:["package.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},java:{language:"java",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["pom.xml","build.gradle"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},scala:{language:"scala",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.sbt"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},kotlin:{language:"kotlin",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.gradle.kts"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},rust:{language:"rust",indexerBinary:"rust-analyzer",checkCommand:"rust-analyzer --version",indexArgs:({outputPath:e})=>({binary:"rust-analyzer",args:["scip",".","--output",e]}),markerFiles:["Cargo.toml"],installMethods:[{label:"rustup",prerequisite:"rustup",binary:"rustup",args:["component","add","rust-analyzer"]}],installUrl:"https://github.com/rust-lang/rust-analyzer"},python:{language:"python",indexerBinary:"scip-python-plus",binaryAliases:["scip-python"],checkCommand:"scip-python-plus --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--output",e,"--project-name","project"]}),markerFiles:["pyproject.toml","setup.py"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-python-plus"]}],installUrl:"https://github.com/PlunderStruck/scip-python",bundledNpmPackage:"scip-python-plus"},ruby:{language:"ruby",indexerBinary:"scip-ruby",checkCommand:"scip-ruby --version",indexArgs:({indexerBinary:e})=>({binary:e,args:["--dir","."]}),defaultOutputPath:"index.scip",markerFiles:["Gemfile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-ruby/releases"},go:{language:"go",indexerBinary:"scip-go",checkCommand:"scip-go --version",indexArgs:({outputPath:e})=>({binary:"scip-go",args:["--output",e]}),markerFiles:["go.mod"],installMethods:[{label:"go install",prerequisite:"go",binary:"go",args:["install","github.com/sourcegraph/scip-go@latest"]}],installUrl:"https://github.com/sourcegraph/scip-go"},cpp:{language:"cpp",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},c:{language:"c",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},csharp:{language:"csharp",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",ae(e,[".sln",".csproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.csproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},vb:{language:"vb",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",ae(e,[".sln",".vbproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.vbproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},dart:{language:"dart",indexerBinary:"scip-dart",checkCommand:"scip-dart --version",indexArgs:({indexerBinary:e,outputPath:n})=>({binary:e,args:["--output",n]}),markerFiles:["pubspec.yaml"],installMethods:[{label:"dart pub",prerequisite:"dart",binary:"dart",args:["pub","global","activate","scip_dart"]}],installUrl:"https://github.com/Workiva/scip-dart/releases"},php:{language:"php",indexerBinary:"scip-php",projectLocalBinaries:["vendor/davidrjenni/scip-php/bin/scip-php","vendor/bin/scip-php"],checkCommand:"scip-php --version",indexArgs:({projectRoot:e,indexerBinary:n})=>{let t=D(e,"vendor","bin","scip-php"),r=D(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",se(r)?r:se(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function k(e){return ue[e]}function ae(e,n){let t;try{t=mn(e)}catch{return null}for(let r of t)if(n.some(o=>r.endsWith(o)))return D(e,r);return null}import{readFileSync as fn,writeFileSync as hn}from"fs";import{create as E}from"@bufbuild/protobuf";import{deserializeSCIP as bn,serializeSCIP as yn,DocumentSchema as xn,IndexSchema as Sn,SymbolInformationSchema as Rn}from"@c4312/scip";function ce(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let n=vn(e),t=kn(e.flatMap(o=>o.documents??[])),r=le(e.flatMap(o=>o.externalSymbols??[]));return E(Sn,{metadata:n,documents:t,externalSymbols:r})}function V(e,n){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let t=e.map(o=>bn(fn(o))),r=ce(t);return hn(n,Buffer.from(yn(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function vn(e){let n=e[0]?.metadata;if(!n)return;let t=n.projectRoot;for(let r of e.slice(1)){let o=r.metadata?.projectRoot;if(t&&o&&o!==t)throw new Error(`Cannot merge SCIP indexes with different project roots: ${t} vs ${o}`)}return n}function kn(e){let n=new Map;for(let t of e){let r=n.get(t.relativePath);if(!r){n.set(t.relativePath,t);continue}n.set(t.relativePath,E(xn,{language:r.language||t.language,relativePath:r.relativePath||t.relativePath,occurrences:[...r.occurrences,...t.occurrences],symbols:le([...r.symbols,...t.symbols]),text:Pn(r.text,t.text),positionEncoding:r.positionEncoding||t.positionEncoding}))}return[...n.values()]}function le(e){let n=new Map;for(let t of e){let r=n.get(t.symbol);if(!r){n.set(t.symbol,t);continue}n.set(t.symbol,E(Rn,{symbol:r.symbol,documentation:Ln([...r.documentation,...t.documentation]),relationships:In([...r.relationships,...t.relationships]),kind:r.kind||t.kind,displayName:r.displayName||t.displayName,enclosingSymbol:r.enclosingSymbol||t.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??t.signatureDocumentation}))}return[...n.values()]}function In(e){let n=new Set,t=[];for(let r of e){let o=[r.symbol,r.isReference?"1":"0",r.isImplementation?"1":"0",r.isTypeDefinition?"1":"0",r.isDefinition?"1":"0"].join("|");n.has(o)||(n.add(o),t.push(r))}return t}function Pn(e,n){return e?n?e.length>=n.length?e:n:e:n}function Ln(e){return[...new Set(e)]}import{execFileSync as Cn}from"child_process";import{createHash as wn}from"crypto";import{readdirSync as On,readFileSync as Fn}from"fs";import{join as pe}from"path";function ge(e){return(En(e)??Vn(e)).filter(n=>n&&!de(n)).sort()}function S(e,n={}){return(n.language?ge(e).filter(r=>Dn(r,n.language,n.markerFiles)):ge(e)).map(r=>{let o=pe(e,r);try{let i=Fn(o);return{path:r,size:i.byteLength,hash:wn("sha256").update(i).digest("hex")}}catch{return{path:r,size:-1,hash:"unreadable"}}})}function Dn(e,n,t){let r=e.split("/").at(-1)??e;if(t?.includes(e)||t?.includes(r)||jn.has(r))return!0;let o=e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:"";return(Mn[n]??[]).includes(o)}function En(e){try{return Cn("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as ProjectConfig, a as SupportedLanguage } from './config-types-
|
|
1
|
+
import { P as ProjectConfig, a as SupportedLanguage } from './config-types-Bj4sh28g.js';
|
|
2
2
|
export { g as getScipVersion, i as isScipInstalled, p as printScipInstallInstructions } from './scip-cli-a-xOztiK.js';
|
|
3
3
|
|
|
4
4
|
type WatcherStatus = {
|
package/dist/runtime.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as
|
|
2
|
-
`),t}function f(i){return
|
|
1
|
+
import{b as $,c as T,d as E}from"./chunk-NXIAHE7F.js";import{a as v}from"./chunk-UUBMFL3F.js";import{readFileSync as D,writeFileSync as A,existsSync as b,mkdirSync as _}from"fs";import{join as c,resolve as C}from"path";import{createHash as W}from"crypto";import{homedir as F}from"os";var h=".scipquery.json",M={enabled:!1,debounceMs:3e4,cooldownMs:6e4,ignore:[]};function L(i){let e=c(i,h);if(!b(e))return{};try{let t=D(e,"utf-8");return JSON.parse(t)}catch(t){let s=t instanceof Error?t.message:String(t);throw t instanceof SyntaxError?new Error(`invalid ${h} at ${e}: ${s}`,{cause:t}):new Error(`unable to read ${h} at ${e}: ${s}`,{cause:t})}}function P(i){return{...M,...i.watch}}function N(i,e){let t=process.env.SCIP_QUERY_CACHE_DIR;if(t)return f(t);if(e?.dbPath)return f(C(i,e.dbPath));let n=process.env.XDG_CACHE_HOME||c(F(),".cache"),r=W("sha256").update(C(i)).digest("hex").slice(0,12),o=c(n,"scip-query","projects",r);return f(o)}function m(i,e){let t=N(i,e);return{cacheDir:t,dbPath:c(t,"index.db"),indexPath:c(t,"index.scip"),metaPath:c(t,"meta.json")}}function O(i,e){let t=c(i,h);return b(t)||A(t,JSON.stringify({languages:e,watch:{enabled:!1,debounceMs:3e4,cooldownMs:6e4}},null,2)+`
|
|
2
|
+
`),t}function f(i){return _(i,{recursive:!0}),i}import{watch as q}from"fs";import{existsSync as R,renameSync as I}from"fs";import{join as U,relative as B}from"path";import{fork as G}from"child_process";import H from"ignore";var y=class{projectRoot;watchConfig;indexPaths;languages;pnpmWorkspaces;onStatus;onReindexComplete;onError;status={state:"idle"};debounceTimer=null;cooldownTimer=null;dirty=!1;changedFiles=0;reindexInFlight=!1;lastReindexEnd=0;fsWatchers=[];gitignoreFilter;extraIgnore;stopped=!1;constructor(e){this.projectRoot=e.projectRoot,this.watchConfig=P(e.config),this.indexPaths=m(e.projectRoot,e.config),this.languages=e.languages,this.pnpmWorkspaces=e.config.indexer?.typescript?.pnpmWorkspaces??!1,this.onStatus=e.onStatus??(()=>{}),this.onReindexComplete=e.onReindexComplete??(()=>{}),this.onError=e.onError??(t=>console.error(t.message)),this.gitignoreFilter=v(e.projectRoot),this.extraIgnore=H(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore)}start(){this.stopped=!1,this.setStatus({state:"idle"});try{let e=q(this.projectRoot,{recursive:!0},(t,s)=>{s&&!this.stopped&&this.handleFileChange(s)});this.fsWatchers.push(e)}catch{this.onError(new Error("Failed to start file watcher. On Linux, you may need to increase inotify limits: sysctl -w fs.inotify.max_user_watches=524288"))}}stop(){this.stopped=!0;for(let e of this.fsWatchers)e.close();this.fsWatchers=[],this.clearDebounceTimer(),this.clearCooldownTimer(),this.setStatus({state:"idle"})}handleFileChange(e){let t=B(this.projectRoot,U(this.projectRoot,e));if(this.gitignoreFilter.isIgnored(t)||this.extraIgnore.ignores(t)||e.endsWith("index.db")||e.endsWith("index.scip")||e.endsWith("index.db.tmp")||e.endsWith(".scipquery.json"))return;if(this.changedFiles++,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}this.clearDebounceTimer();let s=Date.now()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:s}),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let e=Date.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&e<this.watchConfig.cooldownMs){let s=this.watchConfig.cooldownMs-e;this.dirty=!0;let n=Date.now()+s;this.setStatus({state:"cooldown",until:n,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},s);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let t=Date.now();this.setStatus({state:"indexing",startedAt:t}),this.runReindex().then(s=>{if(this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onReindexComplete(s),this.dirty&&!this.stopped){let n=Date.now()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:n,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(s=>{this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onError(s instanceof Error?s:new Error(String(s))),this.setStatus({state:"idle"})})}runReindex(){return new Promise((e,t)=>{let s=Date.now(),n=this.indexPaths.dbPath+".tmp",r=X(this.indexPaths.indexPath),o=G(new URL("./reindex-worker.js",import.meta.url).pathname,[],{env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:this.projectRoot,SCIP_REINDEX_OUTPUT_SCIP:r,SCIP_REINDEX_OUTPUT_DB:n,SCIP_REINDEX_LANGUAGES:this.languages?.join(",")??"",SCIP_REINDEX_PNPM_WORKSPACES:this.pnpmWorkspaces?"1":""},stdio:"pipe"});o.on("exit",d=>{if(d===0)try{R(n)&&I(n,this.indexPaths.dbPath),R(r)&&I(r,this.indexPaths.indexPath),e(Date.now()-s)}catch(a){t(new Error(`Atomic swap failed: ${a}`))}else t(new Error(`Reindex worker exited with code ${d}`))}),o.on("error",t)})}setStatus(e){this.status=e,this.onStatus(e)}clearDebounceTimer(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}clearCooldownTimer(){this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null)}};function X(i){return i.endsWith(".scip")?i.slice(0,-5)+".tmp.scip":i+".tmp.scip"}import{existsSync as x,mkdirSync as J,symlinkSync as V,readlinkSync as K,unlinkSync as Q}from"fs";import{join as p,dirname as j,resolve as w}from"path";import{homedir as S,platform as Y}from"os";import{fileURLToPath as z}from"url";var Z=Y()==="win32",ee=["scip-query","scip-query-setup","concrete-plan","scip-ai-cleanup","scip-explore","scip-debloat","scip-doc-reconcile","scip-directory-architecture","scip-maintainability","scip-react-maintainability","scip-vue-maintainability","scip-verify","scip-language-playbook"];function te(i={}){let e=i.quiet?()=>{}:console.log,t=z(import.meta.url),s=w(j(t),"..","skills"),n=[p(S(),".claude","skills"),p(S(),".codex","skills"),p(S(),".agents","skills")],r={installed:[],skipped:[],alreadyLinked:[]};for(let o of n){let d=j(o);if(!x(d))continue;J(o,{recursive:!0});let a=ie(o);for(let l of ee){let g=p(s,l),u=p(o,l);if(!x(g)){r.skipped.push(`${a}/${l}`);continue}if(x(u)){try{let k=K(u);if(w(k)===w(g)){r.alreadyLinked.push(`${a}/${l}`),e(` ok: ${l} \u2192 ${a} (already linked)`);continue}}catch{r.skipped.push(`${a}/${l}`),e(` skip: ${l} \u2192 ${a} (exists, not a symlink)`);continue}Q(u)}V(g,u,Z?"junction":"dir"),r.installed.push(`${a}/${l}`),e(` done: ${l} \u2192 ${a}`)}}return r}function ie(i){return i.includes(".codex")?"Codex":i.includes(".agents")?"Agents":"Claude"}export{y as Watcher,T as getScipVersion,O as initProjectConfig,te as installSkills,$ as isScipInstalled,L as loadProjectConfig,E as printScipInstallInstructions,m as resolveIndexPaths};
|
|
3
3
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -55,9 +55,10 @@ This syntax summary is generated from the CLI command descriptors. Keep workflow
|
|
|
55
55
|
| `react-large-component-pressure [file]` | Find heuristic large React component pressure candidates from component lines, JSX structure, and hook behavior | `--min-component-lines <n>`<br>`--min-file-lines <n>`<br>`--min-jsx-tokens <n>`<br>`--min-behavior-tokens <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
56
56
|
| `vue-component-duplicates [file]` | Find heuristic duplicated Vue component structure candidates from template tags, bindings, slots, and directives | `--min-similarity <n>`<br>`--min-tokens <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
57
57
|
| `vue-composable-candidates [file]` | Find heuristic Vue composable extraction candidates from shared state, effects, requests, and template bindings | `--min-similarity <n>`<br>`--min-shared-behaviors <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
58
|
-
| `vue-large-view-pressure [file]` | Find heuristic large Vue view pressure candidates from template, script, style, and external script line counts | `--min-total-lines <n>`<br>`--min-template-lines <n>`<br>`--min-script-lines <n>`<br>`--min-style-lines <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
58
|
+
| `vue-large-view-pressure [file]` | Find heuristic large Vue view pressure candidates from template, script, style, and external script line counts | `--min-total-lines <n>`<br>`--min-template-lines <n>`<br>`--min-script-lines <n>`<br>`--min-style-lines <n>`<br>`--review-thresholds`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
59
59
|
| `similar-chains` | Find heuristic similar-chain candidates from dependency flows | `--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-length <n>`<br>`--max-length <n>`<br>`--full`<br>`--json` |
|
|
60
60
|
| `extract-candidates` | Find heuristic extraction candidates from isolated callee clusters | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--min-callees <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
61
|
+
| `locality-candidates [symbol-or-file]` | Find directory-locality and ancestry candidates from consumer ownership | `-s, --scope <path>`<br>`--min-consumers <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
61
62
|
| `cleanup-plan` | Ordered, batched deletion plan: graph-fact dead code plus the cascade candidates it unlocks | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--max-depth <n>`<br>`--verify`<br>`--patch`<br>`--json`<br>`--full` |
|
|
62
63
|
| `cleanup-apply` | Apply a compiler-verified cleanup-plan batch to the working tree | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--max-depth <n>`<br>`--verified`<br>`--batch <n>`<br>`--all`<br>`--force-dirty`<br>`--full` |
|
|
63
64
|
| `recent-duplicates` | Directional duplicate candidates: recent code that re-implements established callable, React, or Vue code | `--window <n>`<br>`--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
@@ -114,7 +115,7 @@ This syntax summary is generated from the CLI command descriptors. Keep workflow
|
|
|
114
115
|
|
|
115
116
|
| Command | Description | Options |
|
|
116
117
|
|---|---|---|
|
|
117
|
-
| `install-skills` | Install skills (scip-query, concrete-plan, scip-ai-cleanup, scip-explore, scip-debloat, scip-doc-reconcile, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook) into Claude Code, Codex, and shared agent roots | - |
|
|
118
|
+
| `install-skills` | Install skills (scip-query, scip-query-setup, concrete-plan, scip-ai-cleanup, scip-explore, scip-debloat, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook) into Claude Code, Codex, and shared agent roots | - |
|
|
118
119
|
| `check-deps` | Check whether scip-query and the detected language indexers are actually runnable | - |
|
|
119
120
|
| `capabilities` | Report which evidence and verification capabilities are available in this project | `--json` |
|
|
120
121
|
| `capability-matrix` | Report the evidence and verification capability matrix by language | `--json` |
|