scip-query 0.9.0 → 0.10.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 +115 -58
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-23FVN4Y5.js +2 -0
- package/dist/chunk-24PFLKFK.js +2 -0
- package/dist/{chunk-VTF5EH22.js → chunk-27KPKLRJ.js} +2 -2
- package/dist/chunk-2NLK4INB.js +2 -0
- package/dist/{chunk-TA4DDU7J.js → chunk-2XKAMW6B.js} +2 -2
- package/dist/{chunk-PE4EJOLN.js → chunk-332L7SRO.js} +2 -2
- package/dist/chunk-44JOJLMO.js +38 -0
- package/dist/{chunk-U254PV4S.js → chunk-4EAANIWC.js} +2 -2
- package/dist/{chunk-ITUU3VE3.js → chunk-4N7LFYSD.js} +2 -2
- package/dist/{chunk-7I6KNKE3.js → chunk-5ALI77D7.js} +2 -2
- package/dist/{chunk-V76FCF5F.js → chunk-5BZOSICN.js} +2 -2
- package/dist/{chunk-RIXOMSOR.js → chunk-5D3BT4B4.js} +2 -2
- package/dist/{chunk-YSSTUCNS.js → chunk-5HDYAOSF.js} +2 -2
- package/dist/{chunk-NK7TQQG4.js → chunk-5IDEQEM4.js} +2 -2
- package/dist/{chunk-AGW2MVIO.js → chunk-5VB3WU7K.js} +2 -2
- package/dist/chunk-623UQCVG.js +2 -0
- package/dist/chunk-62NMBOA5.js +2 -0
- package/dist/chunk-64LH2QUP.js +62 -0
- package/dist/{chunk-PG3ZI5IH.js → chunk-65UWNXEH.js} +1 -1
- package/dist/{chunk-NGLRXEWN.js → chunk-6TWFT4Y5.js} +2 -2
- package/dist/chunk-6U4EODW3.js +2 -0
- package/dist/{chunk-SDGCKEB7.js → chunk-6YKJSETN.js} +2 -2
- package/dist/chunk-A2GVUCZR.js +8 -0
- package/dist/{chunk-WEJYUS5O.js → chunk-ADKQX2OY.js} +2 -2
- package/dist/{chunk-I7OTKWNY.js → chunk-ADTG377O.js} +2 -2
- package/dist/chunk-ATGRITZP.js +20 -0
- package/dist/chunk-B3HMRQDA.js +2 -0
- package/dist/chunk-B75HZHUP.js +2 -0
- package/dist/chunk-BGBBVSH4.js +2 -0
- package/dist/chunk-BJ7OHKB5.js +2 -0
- package/dist/{chunk-VN6B6HFB.js → chunk-CCB45WDY.js} +2 -2
- package/dist/chunk-CFLYMEUS.js +2 -0
- package/dist/chunk-CMGOXDVP.js +22 -0
- package/dist/chunk-DBIG4QAJ.js +2 -0
- package/dist/{chunk-RCRK4E7E.js → chunk-DMLPJ75B.js} +2 -2
- package/dist/chunk-DRU74YUM.js +71 -0
- package/dist/chunk-DTERBKUE.js +7 -0
- package/dist/{chunk-EKP7XJ6L.js → chunk-E55WCTLH.js} +2 -2
- package/dist/{chunk-ZJ737ZMD.js → chunk-F4PKYBQB.js} +2 -2
- package/dist/{chunk-HDA2V5DC.js → chunk-FVX4GEAC.js} +2 -2
- package/dist/{chunk-TR5AU6A5.js → chunk-GTNPPGZJ.js} +2 -2
- package/dist/{chunk-TFO4OMJZ.js → chunk-GZXXBDJA.js} +2 -2
- package/dist/chunk-HCQ7J2N5.js +3 -0
- package/dist/chunk-HQHFMPLJ.js +2 -0
- package/dist/{chunk-D43L5PQF.js → chunk-I6PTB2CM.js} +2 -2
- package/dist/{chunk-VHENVDS2.js → chunk-IJYWCB57.js} +2 -2
- package/dist/chunk-JTRY2YRJ.js +2 -0
- package/dist/chunk-L77GXANO.js +6 -0
- package/dist/{chunk-UUDYI3FF.js → chunk-LT6GJ27X.js} +2 -2
- package/dist/chunk-LUBKUISI.js +2 -0
- package/dist/{chunk-VQGQHIAT.js → chunk-LVYXX7ZW.js} +2 -2
- package/dist/{chunk-3YQO3S5D.js → chunk-LWPEZ4FP.js} +2 -2
- package/dist/chunk-LWWZBABT.js +2 -0
- package/dist/chunk-LXM7AHQG.js +4 -0
- package/dist/chunk-LY6NRJPJ.js +2 -0
- package/dist/chunk-LYS4SMAQ.js +2 -0
- package/dist/{chunk-7TYJD45F.js → chunk-MESUJJVQ.js} +2 -2
- package/dist/{chunk-6HP3BKIP.js → chunk-MHAQXOZY.js} +2 -2
- package/dist/chunk-N2T2GPYQ.js +2 -0
- package/dist/chunk-OB6PEVI3.js +2 -0
- package/dist/chunk-PNN3D4BE.js +2 -0
- package/dist/{chunk-46ILZVMX.js → chunk-PV4CEDIL.js} +2 -2
- package/dist/chunk-QH5GTVVB.js +3 -0
- package/dist/{chunk-WC43FMAB.js → chunk-QOFKVNFE.js} +2 -2
- package/dist/chunk-QUKZ77A6.js +4 -0
- package/dist/chunk-R42LZMLX.js +2 -0
- package/dist/{chunk-GD7XRHSV.js → chunk-R7S3UCDR.js} +2 -2
- package/dist/chunk-RGDUIMNE.js +3 -0
- package/dist/{chunk-TCCUWKH4.js → chunk-RNLUCQJB.js} +2 -2
- package/dist/chunk-RYBMW2EN.js +2 -0
- package/dist/{chunk-6ZFKI5EP.js → chunk-SA6B3EGD.js} +2 -2
- package/dist/chunk-T67R7V5I.js +2 -0
- package/dist/chunk-TMS4JPWY.js +3 -0
- package/dist/chunk-TTGWDUJ4.js +5 -0
- package/dist/chunk-TUAPDKBI.js +2 -0
- package/dist/chunk-UVK3SL4Z.js +2 -0
- package/dist/chunk-W3PQRAI4.js +2 -0
- package/dist/{chunk-LBAMALDV.js → chunk-WWFBDM5Y.js} +2 -2
- package/dist/{chunk-AQYBOORI.js → chunk-WZVTADY7.js} +1 -1
- package/dist/chunk-XGGTESMN.js +2 -0
- package/dist/{chunk-2DVVHNC3.js → chunk-Y33GRQK6.js} +2 -2
- package/dist/{chunk-BCFED24F.js → chunk-YIE5FZAF.js} +2 -2
- package/dist/chunk-YISMWW66.js +7 -0
- package/dist/chunk-YVQUQIBM.js +5 -0
- package/dist/{chunk-Z2AJQ7VA.js → chunk-YYCQQBMG.js} +2 -2
- package/dist/cli.js +240 -232
- package/dist/{config-types-CGIeLEpY.d.ts → config-types-Bok4jrO3.d.ts} +29 -1
- package/dist/{db-DdTPetj5.d.ts → db-BkFlkzI3.d.ts} +1 -1
- package/dist/{health-C6r2VgpA.d.ts → health-CbGMdRPg.d.ts} +42 -3
- package/dist/index.d.ts +7 -6
- package/dist/index.js +1 -1
- package/dist/postinstall.js +2 -2
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -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 +5 -4
- 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 +2 -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 +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -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 +25 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +20 -4
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- 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 +4 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +11 -5
- 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/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 +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +31 -0
- package/dist/queries/react-component-duplicates.js +2 -0
- package/dist/queries/react-hook-candidates.d.ts +34 -0
- package/dist/queries/react-hook-candidates.js +2 -0
- package/dist/queries/react-large-component-pressure.d.ts +28 -0
- package/dist/queries/react-large-component-pressure.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +10 -3
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- 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 +8 -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 +2 -2
- 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-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +35 -0
- package/dist/queries/vue-component-duplicates.js +2 -0
- package/dist/queries/vue-composable-candidates.d.ts +34 -0
- package/dist/queries/vue-composable-candidates.js +2 -0
- package/dist/queries/vue-large-view-pressure.d.ts +31 -0
- package/dist/queries/vue-large-view-pressure.js +2 -0
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +10 -10
- package/dist/reindex.d.ts +1 -1
- package/dist/reindex.js +22 -22
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -2
- package/docs/AGENT_GUIDE.md +353 -0
- package/docs/AI_FAILURE_MODES.md +278 -0
- package/docs/API.md +40 -0
- package/docs/COMMAND_REFERENCE.md +130 -0
- package/docs/DETECTOR_GUIDE.md +119 -0
- package/docs/accuracy-hardening-goal.md +54 -0
- package/docs/assets/scip-query-logo-dark.svg +21 -0
- package/docs/assets/scip-query-logo.svg +24 -0
- package/package.json +31 -3
- package/skills/scip-maintainability/SKILL.md +24 -3
- package/skills/scip-query/SKILL.md +2 -1
- package/skills/scip-react-maintainability/SKILL.md +114 -0
- package/skills/scip-vue-maintainability/SKILL.md +130 -0
- package/dist/chunk-2Y2WIJI4.js +0 -2
- package/dist/chunk-44G4P3GJ.js +0 -2
- package/dist/chunk-64UY7VTR.js +0 -63
- package/dist/chunk-6G76D2YM.js +0 -2
- package/dist/chunk-APLCSDXL.js +0 -4
- package/dist/chunk-CVRXOP6M.js +0 -3
- package/dist/chunk-EAU4RDFG.js +0 -2
- package/dist/chunk-FYT2PE7C.js +0 -2
- package/dist/chunk-I66MQD5U.js +0 -2
- package/dist/chunk-IBM6FXOQ.js +0 -3
- package/dist/chunk-JTCEWV7Q.js +0 -2
- package/dist/chunk-K3V6XUTL.js +0 -2
- package/dist/chunk-L6TOEQ2M.js +0 -2
- package/dist/chunk-LR7E2ATW.js +0 -8
- package/dist/chunk-MX6F756F.js +0 -2
- package/dist/chunk-NM3BZXHA.js +0 -2
- package/dist/chunk-NO2TPMCQ.js +0 -2
- package/dist/chunk-OMNT7E2T.js +0 -4
- package/dist/chunk-PBGTMPJ7.js +0 -2
- package/dist/chunk-PCMVXWDC.js +0 -34
- package/dist/chunk-PLFYFZX3.js +0 -2
- package/dist/chunk-R3G6ERW7.js +0 -7
- package/dist/chunk-SEZZ24IG.js +0 -2
- package/dist/chunk-SLX5XBCD.js +0 -7
- package/dist/chunk-SOGLYIJ4.js +0 -62
- package/dist/chunk-SQ6VENQY.js +0 -6
- package/dist/chunk-T4AK46CM.js +0 -16
- package/dist/chunk-TH4JVC34.js +0 -71
- package/dist/chunk-TQTVM27C.js +0 -6
- package/dist/chunk-VDZL45XI.js +0 -2
- package/dist/chunk-WQFOZIID.js +0 -4
- package/dist/chunk-Y3RUPPIU.js +0 -2
- package/dist/chunk-YO6DU7QZ.js +0 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scip-vue-maintainability
|
|
3
|
+
description: Vue frontend maintainability review using scip-query's Vue SFC, template-duplicate, composable-candidate, large-view, and health commands. Use when reviewing Vue or Nuxt codebases, investigating duplicated components or composables, checking frontend health score pressure, or asking whether agents are reusing Vue code correctly.
|
|
4
|
+
allowed-tools: [Bash, Read, Grep, Glob]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SCIP Vue Maintainability Review
|
|
8
|
+
|
|
9
|
+
This skill reviews Vue frontends by treating `.vue` single-file components as first-class code units. It uses `scip-query` evidence to decide where templates, scripts, styles, external scripts, components, and composables are carrying duplicated concepts or too many reasons to change.
|
|
10
|
+
|
|
11
|
+
A Vue component duplicate candidate is a pair or group of rendered interface structures that repeat the same user-facing arrangement, controls, states, or data-presentation shape enough that a shared component may reduce future divergence.
|
|
12
|
+
|
|
13
|
+
A Vue composable candidate is a pair or group of script behaviors that repeat the same state lifecycle, effects, requests, validation, persistence, or derived-data policy enough that a shared composable may make the behavior easier to preserve.
|
|
14
|
+
|
|
15
|
+
Large view pressure is a maintainability signal that one SFC or linked view file contains several kinds of knowledge that change for different reasons, such as layout structure, state management, data loading, styling, and feature policy.
|
|
16
|
+
|
|
17
|
+
Vue health is a repo-grounded frontend pressure map. It is useful for ranking review attention, but it is not proof that code is bad and not the goal of a refactor.
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
Refresh the code intelligence before trusting graph facts:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
scip-query status
|
|
25
|
+
scip-query reindex
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If Vue files need rich internals, find the relevant TypeScript project and augment the index:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
find . -name 'tsconfig*.json' -not -path '*/node_modules/*'
|
|
32
|
+
scip-query augment-vue --project <path-to-tsconfig>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Run the Vue review commands uncapped when doing a serious frontend pass. Do not combine `--full` with `--limit`.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
scip-query vue-component-duplicates --scope <vue-source-scope> --full --json
|
|
39
|
+
scip-query vue-composable-candidates --scope <vue-source-scope> --full --json
|
|
40
|
+
scip-query vue-large-view-pressure --scope <vue-source-scope> --full --json
|
|
41
|
+
scip-query health --full --json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Workflow
|
|
45
|
+
|
|
46
|
+
1. Bound the review to a Vue source root, feature area, or changed files. Prefer the narrowest scope that still includes likely reuse partners.
|
|
47
|
+
2. Run `augment-vue` when component references, imported composables, script blocks, or linked external scripts matter to the question.
|
|
48
|
+
3. Run the three Vue commands: component duplicates, composable candidates, and large view pressure.
|
|
49
|
+
4. Cross-check the result sets before recommending an extraction:
|
|
50
|
+
- Component duplicate only: inspect for a shared presentational component or an existing component that callers should reuse.
|
|
51
|
+
- Composable candidate only: inspect for a shared behavior, lifecycle, request pattern, validation rule, persistence rule, or derived-state policy.
|
|
52
|
+
- Both component and composable candidate: inspect for a feature-level concept that may need both a component boundary and a composable boundary.
|
|
53
|
+
- Large view only: split by reason to change, not by line count alone.
|
|
54
|
+
5. Open the source files for the top candidates. Similarity is evidence to inspect, not a verdict.
|
|
55
|
+
6. Check existing exports, imports, and call sites before proposing anything new:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
scip-query outline <file>
|
|
59
|
+
scip-query deps <file>
|
|
60
|
+
scip-query rdeps <file>
|
|
61
|
+
scip-query similar-files --scope <vue-source-scope>
|
|
62
|
+
scip-query recent-duplicates --scope <vue-source-scope> --full --json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Acting on Findings
|
|
66
|
+
|
|
67
|
+
Prefer reuse before extraction. If an existing component or composable already names the concept, migrate callers to it instead of creating another one.
|
|
68
|
+
|
|
69
|
+
When extracting:
|
|
70
|
+
|
|
71
|
+
- Extract a component when the repeated knowledge is rendered template structure, props, slots, empty/loading/error states, or design-system composition.
|
|
72
|
+
- Extract a composable when the repeated knowledge is state, lifecycle, requests, validation, persistence, derived data, or shared event policy.
|
|
73
|
+
- Split a large view by reason to change: data loading, permission/policy, layout shell, table/list rendering, form state, and action handling are different reasons.
|
|
74
|
+
- Keep domain-specific variation at the call site when the variation is essential. Do not hide different product rules behind broad option objects.
|
|
75
|
+
|
|
76
|
+
## Post-Change Verification
|
|
77
|
+
|
|
78
|
+
After implementing a component reuse, composable extraction, or large-view split, prove both sides of the work: the new abstraction exists and the old inline copies were migrated.
|
|
79
|
+
|
|
80
|
+
Run the checks that match what changed:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
scip-query diff-impact
|
|
84
|
+
scip-query vue-component-duplicates --scope <vue-source-scope> --full --json
|
|
85
|
+
scip-query vue-composable-candidates --scope <vue-source-scope> --full --json
|
|
86
|
+
scip-query vue-large-view-pressure --scope <vue-source-scope> --full --json
|
|
87
|
+
scip-query recent-duplicates --scope <vue-source-scope> --full --json
|
|
88
|
+
scip-query incomplete-migration
|
|
89
|
+
scip-query unused-params
|
|
90
|
+
scip-query wrapper-candidates --scope <vue-source-scope> --full --json
|
|
91
|
+
scip-query passthrough-candidates --scope <vue-source-scope> --full --json
|
|
92
|
+
scip-query stale-abstractions --scope <vue-source-scope> --include-low-confidence --full --json
|
|
93
|
+
scip-query reindex && scip-query diff-gate
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Use the results this way:
|
|
97
|
+
|
|
98
|
+
- `incomplete-migration`: if a new composable/helper was created and wired somewhere, migrate every unchanged site that still contains the same logic or document why it is not the same behavior.
|
|
99
|
+
- `recent-duplicates`: if the new component/composable is still an echo of established code, delete the echo or reuse the established concept.
|
|
100
|
+
- Vue duplicate commands: the specific candidate pair you acted on should disappear, weaken materially, or be explicitly accepted as essential variation.
|
|
101
|
+
- `unused-params`: remove speculative props/options introduced "for later."
|
|
102
|
+
- wrapper/pass-through/stale checks: remove local wrapper components, composable aliases, or type abstractions that do not enforce a real policy.
|
|
103
|
+
- `diff-gate`: treat every finding as unfinished work unless there is a written reason to accept it.
|
|
104
|
+
|
|
105
|
+
## False Positive Checks
|
|
106
|
+
|
|
107
|
+
- Shared design-system primitives, CSS utility classes, icons, labels, or test IDs are not enough to justify an extraction.
|
|
108
|
+
- Similar templates with different domain lifecycles may justify a presentational component but not a composable.
|
|
109
|
+
- Shared composable usage may mean the right concept is already extracted; look for drift around the shared call, not just another extraction.
|
|
110
|
+
- A large style block creates review pressure, but it is not proof that behavior is duplicated.
|
|
111
|
+
- A local wrapper is justified only when it names a real product concept, enforces a policy, or prevents drift across callers.
|
|
112
|
+
|
|
113
|
+
## Reporting Shape
|
|
114
|
+
|
|
115
|
+
Report findings as a frontend maintainability register:
|
|
116
|
+
|
|
117
|
+
- Executive read: whether the Vue code is consolidating or drifting.
|
|
118
|
+
- Command evidence: exact commands, scope, counts, and whether results were uncapped.
|
|
119
|
+
- Candidate groups: files, repeated UI structure, repeated behavior, and large-view pressure.
|
|
120
|
+
- Recommended extractions: component, composable, view split, reuse existing API, or no action.
|
|
121
|
+
- Post-change proof: commands rerun, candidate pairs resolved or accepted, migration completeness checked, and `diff-gate` result.
|
|
122
|
+
|
|
123
|
+
## Stable Management Calibration
|
|
124
|
+
|
|
125
|
+
When validating against Stable Management, use these known shapes as calibration examples, not hard-coded rules:
|
|
126
|
+
|
|
127
|
+
- `IncidentCategoriesPanel.vue` and `RecordLabelsPanel.vue` should read as both component and behavior pressure.
|
|
128
|
+
- `CardActionMenu.vue` and `CardStatusMenu.vue` should read as behavior/composable pressure.
|
|
129
|
+
- `HorseProfileFarrierVisitsSection.vue` and `HorseProfileVetRecordsSection.vue` should read as component pressure without forcing a composable.
|
|
130
|
+
- `InventoryView.vue` and `FacilityBookingView.vue` should count linked external script pressure when measuring large views.
|
package/dist/chunk-2Y2WIJI4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-V76FCF5F.js";import{a as g}from"./chunk-NO2TPMCQ.js";import{a as d}from"./chunk-6ZFKI5EP.js";import{c as p}from"./chunk-SOGLYIJ4.js";import{c as u,f as c}from"./chunk-WQFOZIID.js";function T(t,r={}){let{scope:l,limit:s=30,scanLimit:f}=r,o=r.files===void 0?null:new Set(r.files),L=new g(t);return b({candidates:()=>L.productionCallableDefinitions({scope:l,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>h(e.relativePath)&&(o===null||o.has(e.relativePath))),scanLimit:f,evaluate:e=>{let n=c(t,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(a=>!a.simple)||n.paramsEndLine>=n.endLine)return null;let y=d(t,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||P(y.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function h(t){let r=u(t);return r==="typescript"||r==="tsx"||r==="javascript"}function P(t,r,l){return t?t.some(s=>s>r&&s<=l):!1}export{T as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2Y2WIJI4.js.map
|
package/dist/chunk-44G4P3GJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as k,d as v}from"./chunk-R3G6ERW7.js";import{existsSync as C,readFileSync as z}from"fs";import{join as A}from"path";var b=/\.(?:md|mdx|rst|txt)$/i;function T(e){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(e)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(e)}var U=3,_=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function H(e,s={}){let{doc:c,limit:u=20,minCoupling:d=U}=s,n=k(e);if(!n)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let r=v(e)??new Set,a=new Map,h=new Map,m=new Set;for(let o of n.commits){let l=[...new Set(o.files)],S=l.filter(i=>b.test(i)),y=l.filter(i=>!b.test(i));for(let i of l){m.add(i);let f=a.get(i)??[];f.push(o.timestamp),a.set(i,f)}for(let i of S){let f=h.get(i);f||(f=new Map,h.set(i,f));for(let t of y)f.set(t,(f.get(t)??0)+1)}}let p=[...r].filter(o=>b.test(o)),M=j(r),x=[];for(let o of p){if(c!==void 0&&!o.includes(c)||c===void 0&&!F(e,o)||c!==void 0&&!C(A(e.config.projectRoot,o)))continue;let l=Math.max(0,...a.get(o)??[]),S=new Map,{resolved:y,broken:i}=w(e,o,r,M,m);for(let t of y){if(t===o||b.test(t))continue;let g=(a.get(t)??[]).filter(D=>D>l).length;g!==0&&S.set(t,{file:t,evidence:"reference",coChanges:0,changesSinceDocUpdate:g})}for(let[t,g]of h.get(o)??[]){if(g<d||!r.has(t))continue;let D=(a.get(t)??[]).filter(E=>E>l).length;if(D===0)continue;let R=S.get(t);R?(R.evidence="both",R.coChanges=g):S.set(t,{file:t,evidence:"co-change",coChanges:g,changesSinceDocUpdate:D})}if(S.size===0&&i.length===0)continue;let f=[...S.values()].sort((t,g)=>g.changesSinceDocUpdate-t.changesSinceDocUpdate);x.push({doc:o,docLastChangedAt:l,staleness:f.reduce((t,g)=>t+g.changesSinceDocUpdate,0)+i.length*10,subjects:f.slice(0,8),brokenReferences:i})}return x.sort((o,l)=>l.staleness-o.staleness),{available:!0,commitsAnalyzed:n.commits.length,docsScanned:p.length,findings:x.slice(0,u)}}function P(e,s){let c=v(e)??new Set,u=j(c),d=[];for(let n of c){if(!F(e,n))continue;let{resolved:r}=w(e,n,c,u,new Set),a=[...r].filter(h=>s.has(h));a.length>0&&d.push({doc:n,cited:a.sort()})}return d}function F(e,s){return b.test(s)&&!T(s)&&C(A(e.config.projectRoot,s))}function j(e){let s=new Map;for(let c of e){let u=c.split("/");for(let d of[2,3]){if(u.length<d)continue;let n=u.slice(-d).join("/"),r=s.get(n)??[];r.push(c),s.set(n,r)}}return s}function w(e,s,c,u,d){let n=new Set,r=new Set,a;try{a=z(A(e.config.projectRoot,s),"utf-8")}catch{return{resolved:n,broken:[]}}for(let h of a.matchAll(_)){let m=h[0].replace(/^\.?\//,"");if(c.has(m)){n.add(m);continue}let p=u.get(m);if(p&&p.length===1){n.add(p[0]);continue}p&&p.length>1||d.has(m)&&r.add(m)}return{resolved:n,broken:[...r]}}export{T as a,H as b,P as c};
|
|
2
|
-
//# sourceMappingURL=chunk-44G4P3GJ.js.map
|
package/dist/chunk-64UY7VTR.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import{l as T}from"./chunk-WEJYUS5O.js";import{d as N,r as k}from"./chunk-SOGLYIJ4.js";import{a as x}from"./chunk-NN3O7TPH.js";import{a as _}from"./chunk-VDZL45XI.js";function p(i,e,t){if(i.has(e))return i.get(e);let n=t();return i.set(e,n),n}import U from"path";function se(i,e){return i.getReferences().map(t=>{let n=t.getNode();return B(n,e)})}function ae(i){let e=i;return typeof e.findReferences=="function"?e.findReferences():[]}function W(i,e,t,n){let r=[];for(let o of ae(i))for(let s of se(o,n))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||r.push(s);for(let o of t)r.push(o);return E(r)}function $(i,e,t,n){let r=[],o=t?.getStart();for(let s of i.getReferences()){let a=s.getNode();y(n,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||r.push({location:B(a,n),node:a}))}return r}function B(i,e){let t=i.getSourceFile(),n=t.getLineAndColumnAtPos(i.getStart());return{file:y(e,t.getFilePath())??t.getBaseName(),line:n.line-1,column:n.column-1}}function H(i,e,t){let n=i.getSourceFile(),r=g(n,i),o=i.getText(),s=new RegExp(`\\b${ce(o)}\\b`,"g"),a=n.getFullText().split(`
|
|
2
|
-
`),l=[];for(let c=0;c<a.length;c++){if(c===r)continue;let f=a[c]??"";s.lastIndex=0;let u;for(;(u=s.exec(f))!==null;)l.push({file:e,line:c,column:u.index})}return E(l.filter(c=>y(t,U.join(t,c.file))===e))}function P(i){for(let e=i;e;e=e.getParent()){let t=e.getKindName();if(t.includes("Type")||t==="InterfaceDeclaration"||t==="TypeAliasDeclaration")return!0;if(t==="CallExpression"||t==="NewExpression"||t==="ExpressionStatement")return!1}return!1}function g(i,e){return i.getLineAndColumnAtPos(e.getStart()).line-1}function E(i){let e=new Set,t=[];for(let n of i){let r=`${n.file}:${n.line}:${n.column}`;e.has(r)||(e.add(r),t.push(n))}return t}function y(i,e){let t=U.relative(i||process.cwd(),e).replace(/\\/g,"/");return!t||t.startsWith("..")?null:t}function ce(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J(i,e,t,n){let r=le(e,n);return r.size===0?new Map:de(i,t,r)}function le(i,e){let t=new Map;for(let n of k(i,e)){let r=N(n.symbol)??n.leaf;if(!r)continue;let o=t.get(r);o||(o=[],t.set(r,o)),o.push(n)}return t}function de(i,e,t){let n=new Map,r=new Map;return e.forEachDescendant(o=>{for(let s of pe(i,o)){let a=t.get(s);if(!a)continue;let l=g(e,o);for(let c of a){if(l<c.startLine-1||l>c.endLine+1)continue;let f=Math.abs(l-c.startLine),u=r.get(c.symbolId);u!==void 0&&u<=f||(r.set(c.symbolId,f),n.set(c.symbolId,o))}}}),n}function pe(i,e){let t=[],n=r=>{r&&!t.includes(r)&&t.push(r)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let r=e.getNameNode();n(r?.getText())}if("getName"in e&&typeof e.getName=="function"){let r=e.getName();n(r)}return i.Node.isIdentifier(e)&&n(e.getText()),t}function V(i,e,t,n){return i.all(`SELECT
|
|
3
|
-
gs.id AS symbolId,
|
|
4
|
-
gs.symbol,
|
|
5
|
-
d.relative_path AS relativePath,
|
|
6
|
-
COALESCE(der.start_line, c.start_line) AS startLine,
|
|
7
|
-
COALESCE(der.end_line, c.end_line) AS endLine,
|
|
8
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
9
|
-
NULL AS parentTypeName,
|
|
10
|
-
CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
11
|
-
CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
|
|
12
|
-
gs.kind AS kind,
|
|
13
|
-
gs.documentation AS documentation,
|
|
14
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
15
|
-
FROM global_symbols gs
|
|
16
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
17
|
-
LEFT JOIN chunks c ON c.document_id = der.document_id
|
|
18
|
-
JOIN documents d ON d.id = der.document_id
|
|
19
|
-
WHERE d.relative_path = ?
|
|
20
|
-
AND COALESCE(gs.display_name, gs.symbol) LIKE ?
|
|
21
|
-
ORDER BY ABS(COALESCE(der.start_line, c.start_line) - ?)
|
|
22
|
-
LIMIT 5`,e,`%${n}%`,t)[0]??null}function K(i,e){let t=i.all(`SELECT
|
|
23
|
-
d.id AS documentId,
|
|
24
|
-
gs.id AS symbolId,
|
|
25
|
-
gs.symbol,
|
|
26
|
-
d.relative_path AS relativePath,
|
|
27
|
-
der.start_line AS startLine,
|
|
28
|
-
der.end_line AS endLine,
|
|
29
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
30
|
-
NULL AS parentTypeName,
|
|
31
|
-
CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
32
|
-
CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
|
|
33
|
-
gs.kind AS kind,
|
|
34
|
-
gs.documentation AS documentation,
|
|
35
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
36
|
-
FROM global_symbols gs
|
|
37
|
-
JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
38
|
-
JOIN documents d ON d.id = der.document_id
|
|
39
|
-
WHERE d.relative_path = ?
|
|
40
|
-
UNION ALL
|
|
41
|
-
SELECT
|
|
42
|
-
d.id AS documentId,
|
|
43
|
-
gs.id AS symbolId,
|
|
44
|
-
gs.symbol,
|
|
45
|
-
d.relative_path AS relativePath,
|
|
46
|
-
MIN(c.start_line) AS startLine,
|
|
47
|
-
MAX(c.end_line) AS endLine,
|
|
48
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
49
|
-
NULL AS parentTypeName,
|
|
50
|
-
CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
51
|
-
CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
|
|
52
|
-
gs.kind AS kind,
|
|
53
|
-
gs.documentation AS documentation,
|
|
54
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
55
|
-
FROM global_symbols gs
|
|
56
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
57
|
-
JOIN chunks c ON c.id = m.chunk_id
|
|
58
|
-
JOIN documents d ON d.id = c.document_id
|
|
59
|
-
WHERE d.relative_path = ?
|
|
60
|
-
AND m.role = 1
|
|
61
|
-
GROUP BY gs.id, gs.symbol, d.id, d.relative_path, gs.display_name, gs.kind, gs.documentation, gs.enclosing_symbol
|
|
62
|
-
ORDER BY startLine, endLine`,e,e),n=new Set,r=new Map;for(let o of t){if(n.has(o.symbolId))continue;n.add(o.symbolId);let s=o.leaf||N(o.symbol);!s||r.has(s)||r.set(s,{...o,leaf:s})}return r}import fe from"path";var S=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function D(i){let e=i.toLowerCase();return S.some(t=>e.endsWith(t))}function z(i,e){let t=new Map,n=r=>D(r)?p(t,r,()=>{let o=fe.join(i.config.projectRoot,r);for(let{project:s}of e){let a=s.getSourceFile(o)??s.addSourceFileAtPathIfExists(o)??null;if(a)return{project:s,sourceFile:a}}return null}):null;return{sourceFile:r=>n(r)?.sourceFile??null,sourceFileMatch:n,indexedTypeScriptLikeDocuments:()=>x(i,{extensions:S})}}import m from"path";import{existsSync as M,readdirSync as ue,readFileSync as Y}from"fs";function X(i){let e=m.join(i,"package.json");if(!M(e))return[];let t;try{t=JSON.parse(Y(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(r=>me(i,r)).flatMap(r=>ge(i,r))}function me(i,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=m.join(i,e);return M(m.join(s,"package.json"))?[s]:[]}let t=e.indexOf("*"),n=e.slice(0,t).replace(/\/$/,""),r=e.slice(t+1).replace(/^\//,""),o=m.join(i,n||".");if(!M(o))return[];try{return ue(o).map(s=>m.join(o,s,r)).filter(s=>M(m.join(s,"package.json")))}catch{return[]}}function ge(i,e){try{let t=JSON.parse(Y(m.join(e,"package.json"),"utf8"));if(!t.name)return[];let n=m.relative(i,e).replace(/\\/g,"/");return[{name:t.name,rootRelative:n,sourceRootRelative:`${n}/src`}]}catch{return[]}}function q(i,e){for(let t of i)if(e===t.name||e.startsWith(`${t.name}/`))return t.name;return null}function G(i){return[`${i.sourceRootRelative}/index.ts`,`${i.sourceRootRelative}/index.tsx`,`${i.sourceRootRelative}/index.mts`,`${i.sourceRootRelative}/index.cts`]}import{existsSync as h,readFileSync as ye,readdirSync as Se,statSync as he}from"fs";import d from"path";var R=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function C(i,e){let n=e?d.dirname(d.join(i,e)):i,r=d.resolve(i);for(;n.startsWith(r);){for(let s of R){let a=d.join(n,s);if(h(a))return a}let o=d.dirname(n);if(o===n)break;n=o}for(let o of R){let s=d.join(i,o);if(h(s))return s}return null}function Q(i){let e=i.config.projectRoot,t=new Set(Ie(e,i.config.semantic?.typescript?.tsconfigs)),n=x(i,{includeIgnored:!1,extensions:S});for(let r of n){let o=C(e,r);o&&t.add(d.resolve(o))}if(t.size===0){let r=C(e);r&&t.add(d.resolve(r))}return[...t].filter(r=>!Z(e,r)).sort((r,o)=>r.localeCompare(o))}function Ie(i,e=[]){let t=new Set;for(let n of e){let r=d.isAbsolute(n)?n:d.join(i,n);h(r)&&t.add(d.resolve(r))}for(let n of be(i))for(let r of R){let o=d.join(n,r);h(o)&&t.add(d.resolve(o))}if(t.size===0){let n=C(i);n&&t.add(d.resolve(n))}return[...t].filter(n=>!Z(i,n)).sort((n,r)=>n.localeCompare(r))}function be(i){let e=d.join(i,"package.json");if(!h(e))return[];let t;try{t=JSON.parse(ye(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(r=>xe(i,r))}function xe(i,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=d.join(i,e);return L(s)?[s]:[]}let t=e.indexOf("*"),n=e.slice(0,t).replace(/\/$/,""),r=e.slice(t+1).replace(/^\//,""),o=d.join(i,n||".");return L(o)?Se(o).map(s=>d.join(o,s,r)).filter(L):[]}function L(i){try{return he(i).isDirectory()}catch{return!1}}function Z(i,e){let t=d.relative(i,e).replace(/\\/g,"/");return t.startsWith("..")||t.includes("/node_modules/")||t.startsWith("node_modules/")||t.includes("/dist/")||t.startsWith("dist/")}import{createRequire as Ne}from"module";var ke=Ne(import.meta.url),I;function ee(){if(I!==void 0)return I;try{I=ke("ts-morph")}catch{I=null}return I}function te(i,e){return e.map(t=>({tsconfigPath:t,project:new i.Project({tsConfigFilePath:t,skipFileDependencyResolution:!1})}))}function F(i,e,t){return{language:"typescript",availability:()=>({available:!1,reason:i,tsconfigPath:e,tsconfigPaths:t}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function re(i,e){let t=ee();if(!t)return F("ts-morph is not installed");let n=Q(i);if(n.length===0)return F("no tsconfig found");try{let r=te(t,n);return new A(i,t,r)}catch(r){return F(r instanceof Error?r.message:String(r),n[0],n)}}var A=class{constructor(e,t,n){this.db=e;this.tsMorph=t;this.projects=n;this.workspacePackages=X(e.config.projectRoot),this.sourceFiles=z(e,n)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return p(this.importUsageCache,e,()=>{let t=this.sourceFiles.sourceFile(e);if(!t)return[];let n=[];for(let r of t.getImportDeclarations())for(let o of this.importUsageForDeclaration(e,r))n.push(o);return n})}referencesFor(e){return p(this.referencesCache,e.symbolId,()=>{let t=this.nodeForDefinition(e),n=this.packageImportReferencesForDefinition(e);return t?W(t,e,n,this.db.config.projectRoot):n})}calleesFor(e){return p(this.calleesCache,e.symbolId,()=>p(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}signatureFor(e){return p(this.signatureCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);if(!t||!this.tsMorph.Node.isFunctionDeclaration(t)&&!this.tsMorph.Node.isMethodDeclaration(t)&&!this.tsMorph.Node.isArrowFunction(t)&&!this.tsMorph.Node.isFunctionExpression(t)&&!this.tsMorph.Node.isConstructorDeclaration(t))return null;let n=t.getType().getCallSignatures()[0];if(!n)return null;let r=n.getParameters().map(s=>{let a=s.getDeclarations()[0],l=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return ie(l)}),o=n.getReturnType().getText(t);return`(${r.join(",")})=>${ie(o)}`})}importUsageForDeclaration(e,t){let n=T(this.db,e,t.getModuleSpecifierValue()),r=ne(t);return t.getImportClause()?.isTypeOnly()?r.map(o=>Ee(e,n,o)):r.map(o=>this.valueImportUsageForEntry(e,n,o))}valueImportUsageForEntry(e,t,n){let r=n.identifier?n.identifier.findReferences():[],o=[];for(let c of r)for(let f of $(c,e,n.identifier,this.db.config.projectRoot))o.push(f);let s=o.some(c=>!P(c.node)),a=o.some(c=>P(c.node)),l=n.isTypeOnly;return{importer:e,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:l,isUsed:l||o.length>0,isTypeUsed:l||a,isValueUsed:s,references:o.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,t=this.packageExports();for(let n of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,t,n);for(let[n,r]of e)e.set(n,E(r));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,t,n){if(this.db.isIgnored(n))return;let r=this.sourceFiles.sourceFileMatch(n);if(r)for(let o of r.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,t,n,o)}addPackageImportReferencesForDeclaration(e,t,n,r){let o=q(this.workspacePackages,r.getModuleSpecifierValue());if(!o)return;let s=t.get(o);if(s)for(let a of ne(r)){if(a.kind!=="named"||!a.identifier)continue;let l=s.get(a.importedName);if(!l||l.size===0)continue;let c=H(a.identifier,n,this.db.config.projectRoot);c.length>0&&Fe(e,l,c)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let e=new Map;for(let t of this.workspacePackages){let n=new Map;for(let r of G(t))this.collectPackageExports(t,r,n,new Set);n.size>0&&e.set(t.name,n)}return this.packageExportIndex=e,e}collectPackageExports(e,t,n,r){if(r.has(t))return;r.add(t);let o=this.sourceFiles.sourceFile(t);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),l=a?T(this.db,t,a):t;if(!l||!l.startsWith(`${e.sourceRootRelative}/`))continue;let c=s.getNamedExports();if(c.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,l,n,r);continue}for(let f of c){let u=f.getNameNode().getText(),w=f.getAliasNode()?.getText()??u,O=this.indexedDefinitionByLeaf(l,u);if(!O)continue;let b=n.get(w);b||(b=new Set,n.set(w,b)),b.add(O.symbolId)}}}indexedDefinitionByLeaf(e,t){return p(this.indexedDefinitionLeafCache,e,()=>K(this.db,e)).get(t)??null}nodeForDefinition(e){return p(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return p(this.fileDefinitionNodeCache,e,()=>{let t=this.sourceFiles.sourceFile(e);return t?J(this.tsMorph,this.db,t,e):new Map})}definitionFromSymbol(e){let t=e.getDeclarations();for(let n of t){let r=n.getSourceFile(),o=y(this.db.config.projectRoot,r.getFilePath());if(!o||this.db.isIgnored(o))continue;let s=g(r,n),a=V(this.db,o,s,e.getName());if(a)return{symbol:a.symbol,file:a.relativePath,line:a.startLine}}return null}calleeMapForFile(e){let t=this.sourceFiles.sourceFile(e);if(!t)return new Map;let n=k(this.db,e).sort((o,s)=>o.startLine-s.startLine||s.endLine-o.endLine);if(n.length===0)return new Map;let r=new Map;t.forEachDescendant(o=>{if(!this.tsMorph.Node.isCallExpression(o)&&!this.tsMorph.Node.isNewExpression(o))return;let s=this.semanticCalleeForCallNode(t,n,o);s&&De(r,s.callerId,s.target)});for(let[o,s]of r)r.set(o,ve(s));return r}semanticCalleeForCallNode(e,t,n){let r=Me(t,g(e,n));if(!r)return null;let o=n.getExpression(),s=o.getSymbol()??o.getType().getSymbol(),a=s?this.definitionFromSymbol(s):null;return a?{callerId:r.symbolId,target:{symbol:a.symbol,file:a.file,line:a.line}}:null}};function ne(i){let e=[],t=i.getDefaultImport();t&&e.push({identifier:t,importedName:"default",localName:t.getText(),kind:"default",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});let n=i.getNamespaceImport();n&&e.push({identifier:n,importedName:"*",localName:n.getText(),kind:"namespace",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});for(let r of i.getNamedImports()){let o=r.getNameNode(),a=r.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:r.isTypeOnly()||(i.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Ee(i,e,t){return{importer:i,sourcePath:e,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function De(i,e,t){let n=i.get(e);n||(n=[],i.set(e,n)),n.push(t)}function Me(i,e){let t=null;for(let n of i)e<n.startLine||e>n.endLine||(!t||n.startLine>=t.startLine)&&(t=n);return t}function Fe(i,e,t){for(let n of e){let r=i.get(n)??[];r.push(...t),i.set(n,r)}}function ve(i){let e=new Set,t=[];for(let n of i){let r=`${n.symbol}|${n.file}|${n.line}`;e.has(r)||(e.add(r),t.push(n))}return t}function ie(i){return i.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}var j=new WeakMap;_({name:"semantic-provider",groups:["semantic-provider"],clearAll:i=>j.delete(i)});function oe(i,e){let t=`${i.config.projectRoot}:typescript-workspace`,n=j.get(i);n||(n=new Map,j.set(i,n));let r=n.get(t);if(r)return r;let o=re(i,e);return n.set(t,o),o}function St(i,e){let t=v(i,e);return t?t.importUsage(e):[]}function Te(i,e){let t=v(i,e.relativePath);return t?t.referencesFor(e):[]}function ht(i,e){let t=new Map;for(let n of e)for(let r of Te(i,n)){if(r.file===n.relativePath||i.isIgnored(r.file))continue;let o=t.get(n.symbolId);o||(o=new Set,t.set(n.symbolId,o)),o.add(r.file)}return t}function It(i,e){let t=new Map;for(let n of e){let r=v(i,n.relativePath);if(!r)continue;let o=r.calleesFor(n);o.length>0&&t.set(n.symbolId,o)}return t}function bt(i,e){let t=v(i,e.relativePath);return t?t.signatureFor(e):null}function v(i,e){if(!D(e))return null;let t=oe(i,e);return t.availability().available?t:null}export{oe as a,St as b,Te as c,ht as d,It as e,bt as f};
|
|
63
|
-
//# sourceMappingURL=chunk-64UY7VTR.js.map
|
package/dist/chunk-6G76D2YM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as f,c as y}from"./chunk-MX6F756F.js";import{f as L}from"./chunk-64UY7VTR.js";import{x as d}from"./chunk-WEJYUS5O.js";import{c as b,o as h,p as S,s as x}from"./chunk-SOGLYIJ4.js";import{a as g}from"./chunk-WQFOZIID.js";function F(n,e={}){let{scope:s,minLoc:t=1,limit:i,scanLimit:a}=e,o=e.semantic!==!1,l=M(n,$(n,{scope:s,minLoc:t,scanLimit:a}),{semantic:o}),r=I(l);return i?r.slice(0,i):r}function $(n,e){let s=x(n,{scope:e.scope}).filter(t=>t.isFunctionLike&&!n.isIgnored(t.relativePath)).filter(t=>f(t)>=e.minLoc);return typeof e.scanLimit=="number"&&e.scanLimit>0&&s.sort((t,i)=>f(i)-f(t)||t.relativePath.localeCompare(i.relativePath)),y(s,e.scanLimit)}function M(n,e,s){let t=new Map;for(let i of e){let a=w(n,i,s);if(!a)continue;let o=t.get(a)??[];o.push(v(i)),t.set(a,o)}return t}function v(n){return{symbol:n.symbol,shortName:b(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:f(n)}}function I(n){let e=[];for(let[s,t]of n)t.length>=2&&e.push({signature:s,functions:t});return e.sort((s,t)=>{let i=t.functions.length-s.functions.length;if(i!==0)return i;let a=s.functions.reduce((l,r)=>l+r.loc,0);return t.functions.reduce((l,r)=>l+r.loc,0)-a}),e}function w(n,e,s){if(s.semantic){let a=L(n,e);if(a)return a}let t=G(e.documentation),i=t?A(t):null;return i||R(P(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function G(n){return h(S(n))}function P(n,e,s,t,i){let a=g(n,e);if(!a)return null;let o=a.split(/\r?\n/),l=E(o,s,t,i);for(let r of l){let p=Math.min(o.length-1,Math.max(r,r+4)),u="";for(let c=r;c<=p;c+=1){let m=o[c]?.trim();if(m&&(u=u?`${u} ${m}`:m,z(u)))return u}if(u&&u.includes("("))return u}return null}function z(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||d(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function A(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(n,e){if(!n||!n.trim())return null;let s=n.replace(/\s+/g," ").trim(),t=s.indexOf("(");if(t===-1)return null;let i=s.slice(0,t),o=new RegExp(`\\b${D(e)}\\b`,"i").exec(i);o&&typeof o.index=="number"&&(i=i.slice(0,o.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let l=C(s.slice(t)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!l.startsWith("("))return null;let r=`${i?`${i} `:""}${l}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function C(n){let e=0,s=0,t=0,i=0,a=null,o=!1;for(let l=0;l<n.length;l+=1){let r=n[l];if(a){if(o){o=!1;continue}if(r==="\\"){o=!0;continue}r===a&&(a=null);continue}if(r==='"'||r==="'"||r==="`"){a=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")t+=1;else if(r==="]")t=Math.max(0,t-1);else if(r==="<")i+=1;else if(r===">")i=Math.max(0,i-1);else if(r==="{"){if(e===0&&t===0&&i===0)return n.slice(0,l);s+=1}else if(r==="}")s=Math.max(0,s-1);else if(r==="="&&n[l+1]===">"&&e===0&&s===0&&t===0&&i===0)return n.slice(0,l)}return n}function E(n,e,s,t){let i=D(t),a=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),o=new RegExp(`\\bdef\\s+${i}\\b`,"i"),l=[],r=new Set,p=Math.max(0,Math.min(e,n.length-1)),u=Math.max(p,Math.min(n.length-1,Math.max(s,e+4)));for(let c=p;c<=u;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}for(let c=0;c<n.length;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}return l}function D(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{F as a};
|
|
2
|
-
//# sourceMappingURL=chunk-6G76D2YM.js.map
|
package/dist/chunk-APLCSDXL.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as te,b as re,c as b,d as se,e as ne,f as oe,g as j,h as ie,i as U,j as ae,k as pe,l as E,m as W,n as T,o as V,p as z,q as S,r as Q,s as J,u as R,v as h,w as M,x as G}from"./chunk-WEJYUS5O.js";import{a as v,c as ce,d as me,e as C}from"./chunk-WQFOZIID.js";import{c as L}from"./chunk-VDZL45XI.js";import{basename as le}from"path";var Oe=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&&Oe.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,pe(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=R(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=C(t,r);if(n){let o=e(n);if(o)return o}return s()}function X(t,r,e,s){let n=C(t,r),o=ce(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function ue(t,r,e){return I(t,r,s=>Ae(t,r,s),()=>ke(t,r,e))}function ke(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=le(o).replace(/\.[^.]+$/,"");return[$(o,i,z(t,r,o),h(n,i))]})}function Ae(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=le(i).replace(/\.[^.]+$/,"");n.push(f(i,a,z(t,r,i),s))}return n}function de(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=R(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 fe(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 ge(t,r,e){return X(t,r,{csharp:s=>Le(t,r,s),vb:s=>we(t,r,s)},()=>{let s=ae(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,j))]})})}function we(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,j),s,p?"namespace":"named"))}return n}function Le(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,j),s,a?"namespace":"named"))}return n}var je=L("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Se(t,r){return je.get(t,r,()=>{let e=new Set,s=v(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 Y(t,r,e){return I(t,r,s=>Me(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return ze(e).flatMap(s=>Qe(t,r,s.clause,s.specifier,s.start,s.end,e))}function Me(t,r,e){let s=$e(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...qe(t,r,e,o,s));return n}function $e(t,r,e){let s=g(e,new Set(["import_statement"]));if(me(r))for(let n of Se(t,r))s.add(n);return s}function qe(t,r,e,s,n){let o=Xe(s);if(!o)return[];let i=E(t,r,o),a=y(s,"import_clause");return a?Ue(e,a,i,n,Be(s.text)):[D("*",i)]}function Ue(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(We(i.text,e,s,n));else if(i.type==="namespace_import"){let a=Fe(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Je(i,e,s,n));return o}function We(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function Fe(t,r,e,s,n){let i=y(r,"identifier")?.text??"";if(!i)return null;let a=Ve(t,i);return O("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Je(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 Xe(t){let r=y(t,"string");if(!r)return null;let e=y(r,"string_fragment");return e?e.text:null}function Be(t){return/^\s*import\s+type\b/.test(t)}function He(t){return/^\s*type\b/.test(t.trim())}function Ve(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 ze(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 Qe(t,r,e,s,n,o,i){let a=E(t,r,s),p=R(i,n,o);return e?Ge(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 Ge(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=Ye(s),i=[];return n&&i.push(...he(n,e)),o&&i.push(...he(o,e)),i}function he(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 Ye(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 K(t,r,e){let s=C(t,r);return s?st(t,r,s):Ke(t,r,e)}function Ke(t,r,e){return[...Ze(t,r,e),...et(t,r,e),...tt(t,r,e)]}function Ze(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=>rt(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 et(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 tt(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 rt(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 st(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=nt(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=ot(n,o,i,a);s.push(p)}return s}function nt(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 ot(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 xe(t,r,e){return X(t,r,{java:s=>it(t,r,s),kotlin:s=>at(t,r,s),scala:s=>pt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?ct(t,r,o,n):[]}))}function it(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 at(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 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.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 ct(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 Ne(t,r,e){return I(t,r,s=>mt(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 mt(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}=ye(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}=ye(p,"");m&&o(l,m,c)}}return n}function ye(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 be(t,r,e){return I(t,r,s=>lt(t,r,s),()=>dt(e).flatMap(s=>gt(t,r,s,e)))}function lt(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=Ie(i);if(!a)continue;let p=W(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=ut(i);if(a===null)continue;let p=W(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=Ie(c);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Ie(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 ut(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 dt(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=G(o);for(;n+1<r.length&&(c>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
|
|
3
|
-
${u}`,m+=1+u.length,c+=G(u),s+=u.length+1}let l=ft(p);l&&e.push({...l,start:a,end:m})}return e}function ft(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 gt(t,r,e,s){let n=R(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(),_=W(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?W(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 St}from"path";function Pe(t,r,e){return I(t,r,s=>xt(t,r,s),()=>ht(t,r,e))}function ht(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=_e(i);return[$(p,p,a,h(n,p))]}return[D(i,a)]})}function xt(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=_e(l);n.push(f(d,d,u,s))}else n.push(D(l,u))}return n}function _e(t){return St(t).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function Ee(t,r,e){return I(t,r,s=>yt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?Nt(t,r,o,n):[]}))}function yt(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 F(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 F(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(...F(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...F(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=F(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 Nt(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+/),w=_?.trim();if(!w)return[];let Ce=(A??w.split("::").pop()??w).trim(),De=`${c}::${w}`.replace(/::::/g,"::");return[P(t,r,s,De,w.split("::").pop()??w,Ce,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 Te(t,r,e){let s=C(t,r);if(s)return It(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(...Pt(t,r,i))}return n}function It(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!bt(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of F(o,""))i.importedName&&s.push(Z(t,r,i.qualifiedName))}return s}function bt(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Pt(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[Z(t,r,m)]})}return[Z(t,r,s)]}function Z(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 Re(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 _t={language:"javascript",extensions:te,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Y,parseReExports:K},Et=k({language:"python",extensions:re,imports:"ast-with-regex-fallback",parseImports:be}),Tt=k({language:"jvm",extensions:b,imports:"ast-dispatch-with-regex-fallback",parseImports:xe}),Rt={language:"rust",extensions:se,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Ee,parseExports:Te},Ct=k({language:"ruby",extensions:ne,imports:"ast-with-regex-fallback",parseImports:Pe}),Dt=k({language:"c/cpp",extensions:oe,imports:"ast-with-regex-fallback",parseImports:ue}),Ot=k({language:"dotnet",extensions:j,imports:"ast-dispatch-with-regex-fallback",parseImports:ge}),kt={language:"dart",extensions:ie,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:de,parseExports:fe},At=k({language:"php",extensions:U,imports:"ast-with-regex-fallback",parseImports:Ne}),wt=[_t,Et,Tt,Rt,Ct,Dt,Ot,kt,At];function H(t){return Re(wt,t)}var ee={clearGroups:["whole-project","source-file"]},Lt=L("source-imports",ee),jt=L("source-exports",ee),vt=L("source-reexports",ee);function Yr(t,r){let e=J(r);return vt.get(t,e,()=>{let s=H(e);if(!s?.parseReExports)return[];let n=v(t,e);return n?s.parseReExports(t,e,n):[]})}function Kr(t,r){let e=J(r);return Lt.get(t,e,()=>{let s=H(e);if(!s)return[];let n=v(t,e);return n?s.parseImports(t,e,n):[]})}function Zr(t,r){let e=J(r);return jt.get(t,e,()=>{let s=H(e);if(!s?.parseExports)return[];let n=v(t,e);return n?s.parseExports(t,e,n):[]})}export{Yr as a,Kr as b,Zr as c};
|
|
4
|
-
//# sourceMappingURL=chunk-APLCSDXL.js.map
|
package/dist/chunk-CVRXOP6M.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-APLCSDXL.js";import{d as x}from"./chunk-SOGLYIJ4.js";import{a as d,c as g,e as y}from"./chunk-WQFOZIID.js";import{c as u}from"./chunk-VDZL45XI.js";var S=u("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function I(t,e,n){return t.callerFileMap(e,{semantic:n.semantic,sourceFallback:n.sourceFallback})}function P(t,e,n){let r=[],i=0,s=0,p=x(e.symbol);for(let a of n)D(t,a,e.relativePath,p)?i++:C(t,a,p)?s++:r.push(a);return{realConsumers:r,barrelConsumers:i,importOnlyConsumers:s}}function C(t,e,n){if(!n)return!1;let r=g(e);if(!r)return!1;let i=S.get(t,e,()=>v(t,e,r));return i.importedLeaves.has(n)&&!i.usedLeaves.has(n)}function v(t,e,n){let r=new Set,i=new Set,s=y(t,e);if(!s)return{importedLeaves:r,usedLeaves:i};let p=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,f)=>{let c=f||p.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(c?r.add(o.text):i.add(o.text));for(let l of o.children)a(l,c)};return a(s.rootNode,!1),{importedLeaves:r,usedLeaves:i}}function D(t,e,n,r){if(!r)return!1;let i=d(t,e);if(!i)return!1;let s=b(t,e);if(s.length===0)return!1;let p=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${p}\\b`),o=i.split(`
|
|
2
|
-
`),f=0;for(let c=0;c<o.length;c++){if(!a.test(o[c]??""))continue;if(f++,!s.find(m=>m.startLine<=c&&c<=m.endLine))return!1}return f>0}export{I as a,P as b,C as c};
|
|
3
|
-
//# sourceMappingURL=chunk-CVRXOP6M.js.map
|
package/dist/chunk-EAU4RDFG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as h}from"./chunk-PCMVXWDC.js";import{e as y,g as S,h as g,i as M,m as C}from"./chunk-6ZFKI5EP.js";import{d as R}from"./chunk-64UY7VTR.js";import{s as b}from"./chunk-SOGLYIJ4.js";import{c as f,i as m,k as p}from"./chunk-WQFOZIID.js";import{a as u}from"./chunk-NN3O7TPH.js";function D(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let i=u(e,{includeIgnored:!1}),a=M(e),r=n??b(e),l=new Set(r.map(s=>s.symbolId));return k(e,o,i,a,l),I(e,o,r,l),x(e,o,i,a,l),t.semantic!==!1&&_(o,R(e,A(r))),o}function k(e,n,t,o,i){for(let a of t){if(!f(a))continue;let r=m(e,a);if(r)for(let l of r){let s=S(a,o.get(l.calleeLeaf)??[]);if(!s||s.length===0)continue;let c=g(e,a,s,l.memberAccess);c&&i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function I(e,n,t,o){let i=v(t);for(let a of L(e,o))e.isIgnored(a.relative_path)||w(a,i.get(a.symbol_id))||d(n,a.symbol_id,a.relative_path)}function L(e,n){return y(e,n?[...n]:void 0)}function v(e){let n=new Map;for(let t of e)n.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return n}function w(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function x(e,n,t,o,i){for(let a of t){if(f(a)!=="rust")continue;let r=p(e,a,{includeRustAttributeNames:!0});if(r.length!==0)for(let{name:l}of r){let s=o.get(l);if(s)for(let c of s)i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function d(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function A(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function _(e,n){for(let[t,o]of n){let i=e.get(t);i||(i=new Set,e.set(t,i));for(let a of o)i.add(a)}}function O(e,n,t={}){return h(e,n,t)}function F(e,n,t={}){return D(e,n,t)}function j(e,n){return C(e,n)}function Q(e,n,t={}){let o=F(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:V(o,j(e,n))}function V(e,n){let t=new Map;for(let[o,i]of e)t.set(o,new Set(i));for(let[o,i]of n){let a=t.get(o)??new Set;for(let r of i)a.add(r);t.set(o,a)}return t}export{O as a,F as b,j as c,Q as d};
|
|
2
|
-
//# sourceMappingURL=chunk-EAU4RDFG.js.map
|
package/dist/chunk-FYT2PE7C.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as m}from"./chunk-UIWAZ2NT.js";import{a as d}from"./chunk-RIXOMSOR.js";function v(t,s={}){let{minSimilarity:o=.5,limit:f=20,scope:n,filePattern:p}=s,l=s.minDeps??(p?1:3),{profiles:e,distinctiveDeps:c}=h(t,{scope:n,minDeps:l}),i=[];if(p){let r=e.find(u=>u.file.includes(p));if(!r)return[];for(let u of e){if(u.file===r.file)continue;let a=g(r,u,o,c);a&&i.push(a)}}else for(let r=0;r<e.length;r++){for(let u=r+1;u<e.length;u++){let a=g(e[r],e[u],o,c);a&&i.push(a)}if(i.length>f*5)break}return i.sort((r,u)=>u.similarity-r.similarity),i.slice(0,f)}function h(t,s){let{scope:o,minDeps:f}=s,n=d(t,o),{universalDeps:p,distinctiveDeps:l}=D(n),e=[];for(let[c,i]of n)i.size>=f&&e.push({file:c,deps:new Set([...i].filter(r=>!p.has(r)))});return{profiles:e,distinctiveDeps:l}}function D(t){let s=new Set,o=new Set,f=t.size;if(f===0)return{universalDeps:s,distinctiveDeps:o};let n=new Map;for(let l of t.values())for(let e of l)n.set(e,(n.get(e)??0)+1);let p=Math.max(3,Math.ceil(f*.03));for(let[l,e]of n)e>=5&&e/f>.3?s.add(l):e<=p&&o.add(l);return{universalDeps:s,distinctiveDeps:o}}function g(t,s,o,f){let n=new Set;for(let i of t.deps)s.deps.has(i)&&n.add(i);if(n.size<3||t.deps.size<4||s.deps.size<4)return null;let p=0;for(let i of n)f.has(i)&&p++;if(p<2)return null;let l=m(t.deps,s.deps);if(l<o)return null;let e=[];for(let i of t.deps)s.deps.has(i)||e.push(i);let c=[];for(let i of s.deps)t.deps.has(i)||c.push(i);return{fileA:t.file,fileB:s.file,similarity:l,sharedDeps:[...n],uniqueToA:e,uniqueToB:c}}export{v as a};
|
|
2
|
-
//# sourceMappingURL=chunk-FYT2PE7C.js.map
|
package/dist/chunk-I66MQD5U.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as p,f as h}from"./chunk-R3G6ERW7.js";import{a as c}from"./chunk-TQTVM27C.js";import{a as d}from"./chunk-RIXOMSOR.js";import{existsSync as A}from"fs";import{join as S}from"path";function T(e){return m.test(e)}var m=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|CHANGELOG(?:\.[a-z]+)?|.*\.map)$|(?:^|\/)(?:dist|build|out|node_modules)\//i;function j(e,i,t={}){let{minTogether:o=4,minConfidence:r=.6,limit:a=30}=t,u=p(e),s=i!==void 0,f=h(e,{minTogether:s?Math.min(o,2):o,minConfidence:s?0:r});if(!u||!f)return{available:!1,commitsAnalyzed:0,findings:[]};let C=d(e),y=t.includeLinked===!0||s,l=[];for(let n of f){if(m.test(n.fileA)||m.test(n.fileB)||!b(e,n.fileA)||!b(e,n.fileB)||s&&!n.fileA.includes(i)&&!n.fileB.includes(i)||!s&&(c(n.fileA)==="test"||c(n.fileB)==="test"||k(n.fileA,n.fileB)))continue;let g=x(C,n.fileA,n.fileB);if(!(!y&&g)&&(l.push({...n,structurallyLinked:g}),l.length>=a))break}return{available:!0,commitsAnalyzed:u.commits.length,findings:l}}function b(e,i){return A(S(e.config.projectRoot,i))}function k(e,i){let t=e.lastIndexOf("/"),o=i.lastIndexOf("/");if(e.slice(0,t)!==i.slice(0,o))return!1;let r=e.slice(t+1).split(".")[0],a=i.slice(o+1).split(".")[0];return r!==""&&r===a}function x(e,i,t){return e.get(i)?.has(t)===!0||e.get(t)?.has(i)===!0}export{T as a,j as b};
|
|
2
|
-
//# sourceMappingURL=chunk-I66MQD5U.js.map
|
package/dist/chunk-IBM6FXOQ.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as _}from"./chunk-2Y2WIJI4.js";import{a as l}from"./chunk-B32FX5KB.js";import{a as B}from"./chunk-OMNT7E2T.js";import{a as G}from"./chunk-AQYBOORI.js";import{a as L}from"./chunk-SLX5XBCD.js";import{a as E}from"./chunk-K3V6XUTL.js";import{a as v}from"./chunk-Y3RUPPIU.js";import{a as A}from"./chunk-U254PV4S.js";import{a as P}from"./chunk-LR7E2ATW.js";import{a as F,b as x}from"./chunk-SQ6VENQY.js";import{b as C}from"./chunk-T4AK46CM.js";import{c as w}from"./chunk-44G4P3GJ.js";import{a as N}from"./chunk-2DVVHNC3.js";import{b as k}from"./chunk-YO6DU7QZ.js";import{a as g}from"./chunk-I66MQD5U.js";import{f as D}from"./chunk-R3G6ERW7.js";import{a as R}from"./chunk-EKP7XJ6L.js";import{a as $}from"./chunk-NO2TPMCQ.js";import{e as d,f as p}from"./chunk-TQTVM27C.js";import{existsSync as I}from"fs";import{existsSync as T,readFileSync as M,writeFileSync as O}from"fs";import{isAbsolute as U,join as q}from"path";var z=75e3,J=5e3,K=2500;function W(e){let t=G(e);return t.symbols>=z||t.documents>=J?K:void 0}var Y=".scipquery-baseline.json";function u(e,t){return t&&U(t)?t:q(e.config.projectRoot,t??Y)}function j(e,t={}){let{scope:n}=t,o=W(e),s=[],c=k(e,{scope:n,...l.dead,scanLimit:o});for(let i of c.symbols)d(e,i.relativePath)||p(e,i.symbol,i.relativePath)||i.kind==="dead-code"&&s.push(`dead:${i.relativePath}:${i.shortName}`);for(let i of E(e,{scope:n,...l.isolated,scanLimit:o}))d(e,i.relativePath)||p(e,i.symbol,i.relativePath)||s.push(`isolated:${i.relativePath}:${i.shortName}`);for(let i of R(e,{scope:n}))i.kind==="real"&&s.push(`cycle:${Q(i.path)}`);for(let i of x(e,{scope:n,...l.similar,scanLimit:o}))s.push(`similar:${[i.symbolA,i.symbolB].sort().join("|")}`);for(let i of A(e,{scope:n,...l.extract,scanLimit:o}))s.push(`extract:${i.relativePath}:${i.shortName}`);for(let i of L(e,{scope:n,...l.wrappers,scanLimit:o}))s.push(`wrapper:${i.file}:${i.shortName}`);for(let i of v(e,{scope:n,...l.passthroughs,scanLimit:o}))s.push(`passthrough:${i.file}:${i.shortName}`);for(let i of B(e,{scope:n,...l.stale,scanLimit:o}))s.push(`stale:${i.file}:${i.shortName}`);for(let i of N(e,{scope:n,...l.drift}).results)i.kind!=="pattern-deviation"&&s.push(`drift:${i.kind}:${i.file}:${i.dep}`);return[...new Set(s)].sort()}function Q(e){if(e.length===0)return"";let t=0;for(let n=1;n<e.length;n++)e[n]<e[t]&&(t=n);return[...e.slice(t),...e.slice(0,t)].join(">")}function be(e,t={}){let n=j(e,{scope:t.scope}),o=u(e,t.path);return O(o,JSON.stringify({version:1,findings:n},null,2)+`
|
|
2
|
-
`),{path:o,findingCount:n.length}}function H(e,t={}){let n=u(e,t.path);if(!T(n))throw new Error(`No baseline found at ${n}. Create one with: scip-query health --write-baseline`);let o=JSON.parse(M(n,"utf-8")),s=new Set(o.findings??[]),c=j(e,{scope:t.scope}),i=new Set(c);return{baselinePath:n,baselineCount:s.size,current:c,newFindings:c.filter(r=>!s.has(r)),fixedFindings:[...s].filter(r=>!i.has(r))}}function xe(e,t={}){let n=t.base??"HEAD",{minTogether:o=6,minConfidence:s=.6,maxEchoChecks:c=10,minSimilarity:i=.8}=t,r=C(e,{base:n}),a=r.changedFiles,h=new Set(a),f={base:n,changedFiles:a,changedSymbols:r.changedSymbols.length,checksRun:[],skipped:[],findings:[],note:r.summary.note};return a.length===0||(V(e,r.changedSymbols,h,c,i,f),X(e,n,f),Z(e,h,o,s,f),ee(e,h,f),ie(e,a,f),ne(e,r.changedSymbols,f),te(e,f)),f}function V(e,t,n,o,s,c){c.checksRun.push("echo");for(let i of t.slice(0,o)){let r=F(e,i.symbol,{minSimilarity:s,limit:3});for(let a of r){let h=a.fileA===i.file?a.fileB:a.fileA,f=a.fileA===i.file?a.shortNameB:a.shortNameA;n.has(h)||c.findings.push({check:"echo",message:`${i.shortName} (${i.file}) is ${Math.round(a.similarity*100)}% similar to established ${f} (${h})`,remediation:`Extend or reuse ${f} instead of keeping the re-implementation.`})}}t.length>o&&c.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${t.length} changed symbols`})}function X(e,t,n){let o=P(e,{base:t});if(!o.available){n.skipped.push({check:"incomplete-migration",reason:"no git history"});return}n.checksRun.push("incomplete-migration"),o.note&&n.skipped.push({check:"incomplete-migration",reason:o.note});for(let s of o.findings){let c=s.leftovers.map(i=>`${i.shortName} (${i.file}, ${Math.round(i.containment*100)}%)`).join(", ");n.findings.push({check:"incomplete-migration",message:`new helper ${s.helperShortName} (${s.helperFile}) is wired into ${s.migratedFiles.length} file(s), but ${s.leftovers.length} similar un-migrated site(s) remain: ${c}`,remediation:`Migrate the remaining sites to ${s.helperShortName}, or confirm they are intentionally different.`})}}function Z(e,t,n,o,s){let c=D(e,{minTogether:n,minConfidence:0});if(!c){s.skipped.push({check:"co-change-partner",reason:"no git history"});return}s.checksRun.push("co-change-partner");let i=new Set;for(let r of c){let a=t.has(r.fileA),h=t.has(r.fileB);if(a===h)continue;let f=a?r.fileA:r.fileB,m=a?r.fileB:r.fileA,y=a?r.changesA:r.changesB,b=y>0?r.together/y:0;if(b<o||g(m)||g(f)||!I(`${e.config.projectRoot}/${m}`))continue;let S=`${f}|${m}`;i.has(S)||(i.add(S),s.findings.push({check:"co-change-partner",message:`${f} changed, but ${m} did not \u2014 they change together ${r.together}x (${Math.round(b*100)}% of the time)`,remediation:`Update ${m} alongside this change, or confirm the coupling no longer holds.`}))}}function ee(e,t,n){n.checksRun.push("doc-reference");for(let o of w(e,t))t.has(o.doc)||n.findings.push({check:"doc-reference",message:`${o.doc} cites ${o.cited.join(", ")} \u2014 changed in this diff, doc untouched`,remediation:`Re-read ${o.doc} and update its claims, or update its citations.`})}function ie(e,t,n){n.checksRun.push("unused-params");for(let o of _(e,{files:t,limit:50}))n.findings.push({check:"unused-params",message:`${o.shortName} (${o.file}) has trailing unused parameter(s): ${o.unusedTrailing.join(", ")}`,remediation:"Drop the unused trailing parameters and their call-site arguments."})}function ne(e,t,n){n.checksRun.push("new-dead");let o=new $(e);for(let s of t)s.fanIn>0||o.fileKind(s.file)!=="test"&&(d(e,s.file)||p(e,s.symbol,s.file)||n.findings.push({check:"new-dead",message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,remediation:"Wire it up, or remove it before it becomes permanent dead code."}))}function te(e,t){if(!I(u(e))){t.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}t.checksRun.push("baseline");let n=H(e);for(let o of n.newFindings)t.findings.push({check:"baseline",message:`new finding vs committed baseline: ${o}`,remediation:"Fix the finding, or knowingly accept it via health --write-baseline."})}export{j as a,be as b,H as c,xe as d};
|
|
3
|
-
//# sourceMappingURL=chunk-IBM6FXOQ.js.map
|
package/dist/chunk-JTCEWV7Q.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as p}from"./chunk-PBGTMPJ7.js";import{a as i}from"./chunk-WQFOZIID.js";import{d as a}from"./chunk-VDZL45XI.js";var g=/scip-query[\s:-]*ignore[\s:-]*(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar)?/gi,y=a("suppression-inventory",{clearGroups:["whole-project"]});function b(e){return y.get(e,()=>d(e))}function d(e){let r={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,uncategorized:0},t=new Map,n=0;for(let o of p(e)){let s=i(e,o);if(!(!s||!s.includes("scip-query")))for(let c of s.matchAll(g)){n+=1,t.set(o,(t.get(o)??0)+1);let u=l(c[1]);r[u]+=1}}return{total:n,byCategory:r,byFile:t}}function l(e){if(!e)return"uncategorized";let r=e.toLowerCase();return r==="dead-code"?"dead":r}export{b as a};
|
|
2
|
-
//# sourceMappingURL=chunk-JTCEWV7Q.js.map
|
package/dist/chunk-K3V6XUTL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as o,c as p}from"./chunk-MX6F756F.js";import{a as y}from"./chunk-NO2TPMCQ.js";import{c as b}from"./chunk-SOGLYIJ4.js";function P(u,c={}){let{scope:f,minLoc:L=3,scanLimit:l}=c,s=new y(u),r=c.semantic!==!1,t=p(s.productionCallableDefinitions({scope:f,minLoc:L,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,sortByLocDesc:typeof l=="number"&&l>0}),l),h=s.crossFileCallerMap(t,{semantic:r}),a=new Set(h.keys());for(let e of s.frameworkReferencedSymbolIds(t))a.add(e);let n=s.symbolsWithNonSelfCallees(t,{additive:!1,semantic:r}),m=t.filter(e=>!a.has(e.symbolId)).filter(e=>!n.has(e.symbolId)),I=s.sourceFallbackCallerFiles(m);for(let e of I.keys())a.add(e);let d=m.filter(e=>!a.has(e.symbolId)),C=s.symbolsWithNonSelfCallees(d,{additive:!0,semantic:r});for(let e of C)n.add(e);return d.filter(e=>!n.has(e.symbolId)).sort((e,i)=>o(i)-o(e)||e.relativePath.localeCompare(i.relativePath)||e.startLine-i.startLine).map(e=>({symbol:e.symbol,shortName:b(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o(e)}))}export{P as a};
|
|
2
|
-
//# sourceMappingURL=chunk-K3V6XUTL.js.map
|
package/dist/chunk-L6TOEQ2M.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as b}from"./chunk-MX6F756F.js";import{a as u}from"./chunk-NO2TPMCQ.js";import{a as f}from"./chunk-EAU4RDFG.js";import{a as c}from"./chunk-PCMVXWDC.js";import{c as l}from"./chunk-SOGLYIJ4.js";function R(o,e={}){let{limit:r=20,scope:s,minFanIn:i=2,minFanOut:n=2,scanLimit:m}=e,p=new u(o);return b(p.productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof m=="number"&&m>0}),m).map(t=>y(o,t,e.semantic!==!1)).filter(t=>t.fanIn>=i&&t.fanOut>=n).sort((t,a)=>a.score-t.score||a.fanIn-t.fanIn).slice(0,r)}function y(o,e,r){let s=new Set(f(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{R as a};
|
|
2
|
-
//# sourceMappingURL=chunk-L6TOEQ2M.js.map
|
package/dist/chunk-LR7E2ATW.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{c as k,d as R}from"./chunk-SQ6VENQY.js";import{d as E}from"./chunk-UIWAZ2NT.js";import{a as w,c as x}from"./chunk-T4AK46CM.js";import{a as N}from"./chunk-NO2TPMCQ.js";import{c as u}from"./chunk-SOGLYIJ4.js";import{execFileSync as $}from"child_process";var A=5;function U(n,l={}){let{base:s="HEAD",minContainment:m=.7,minCallees:c=3,maxHelpers:o=10,limit:a=20}=l,I=l.semantic!==!1,g=x(n,{base:s}),t={available:g.note!==w,base:s,changedFiles:g.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!t.available||g.changedFiles.length===0)return t;let v=new N(n),C=new Set(g.changedFiles),h=O(n,v,C,s);if(h.length===0)return t;let S=h.slice(0,o);h.length>o&&(t.note=`helper scoring capped at ${o} of ${h.length} new symbols`);let d=k(n,{minCallees:Math.min(3,c),semantic:I}),P=v.calleeMap(S,{semantic:I}),D=S.map(e=>({def:e,callees:R((P.get(e.symbolId)??[]).map(i=>i.symbol))})),b=new Map;for(let e of d)for(let i of e.callees)b.set(i,(b.get(i)??0)+1);let L=Math.max(8,Math.ceil(Math.sqrt(d.length)));for(let{def:e,callees:i}of D){let F=u(e.symbol);if(i.size<c){t.skipped.push({helperShortName:F,helperFile:e.relativePath,reason:`fewer than ${c} meaningful callees \u2014 too small to score`});continue}let M=H(n,e.symbolId);if(M.length===0){t.skipped.push({helperShortName:F,helperFile:e.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}t.helpersChecked+=1;let f=[];for(let r of d){if(r.symbol===e.symbol||C.has(r.file)||r.callees.has(e.symbol))continue;let p=E(i,r.callees);if(p<m)continue;let _=[...i].filter(y=>r.callees.has(y));_.some(y=>(b.get(y)??0)<=L)&&f.push({symbol:r.symbol,shortName:u(r.symbol),file:r.file,containment:p,sharedCallees:_.map(u).sort()})}f.length!==0&&(f.sort((r,p)=>p.containment-r.containment||r.file.localeCompare(p.file)),t.findings.push({helperSymbol:e.symbol,helperShortName:F,helperFile:e.relativePath,migratedFiles:M.sort(),leftovers:f.slice(0,A)}))}return t.findings.sort((e,i)=>(i.leftovers[0]?.containment??0)-(e.leftovers[0]?.containment??0)||e.helperFile.localeCompare(i.helperFile)),t.findings=t.findings.slice(0,a),t}function O(n,l,s,m){let c=new Map;return l.productionCallableDefinitions({requireFunctionLikeSymbol:!0}).filter(o=>{if(!s.has(o.relativePath))return!1;let a=c.get(o.relativePath);return a===void 0&&(a=T(n.config.projectRoot,m,o.relativePath),c.set(o.relativePath,a)),a===null||!new RegExp(`\\b${j(o.leaf)}\\b`).test(a)})}function T(n,l,s){try{return $("git",["show",`${l}:./${s}`],{encoding:"utf-8",cwd:n,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function H(n,l){return n.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
${n.pathExclusionsFor("ref_d")}`,l).map(m=>m.relative_path)}function j(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{U as a};
|
|
8
|
-
//# sourceMappingURL=chunk-LR7E2ATW.js.map
|
package/dist/chunk-MX6F756F.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function r(e){return e.endLine-e.startLine+1}function u(e,n){return r(e)-r(n)||e.relativePath.localeCompare(n.relativePath)}function d(e,n){return typeof n!="number"||n<=0||e.length<=n?e:e.slice(0,n)}function f(e){let n=new Set,o=[];for(let t of e){let i=`${t.symbol}|${t.file}`;n.has(i)||(n.add(i),o.push(t))}return o}export{r as a,u as b,d as c,f as d};
|
|
2
|
-
//# sourceMappingURL=chunk-MX6F756F.js.map
|
package/dist/chunk-NM3BZXHA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as I}from"./chunk-JTCEWV7Q.js";import{a as u}from"./chunk-B32FX5KB.js";import{a as F}from"./chunk-OMNT7E2T.js";import{a as k}from"./chunk-AQYBOORI.js";import{a as z}from"./chunk-SLX5XBCD.js";import{a as _}from"./chunk-K3V6XUTL.js";import{a as M}from"./chunk-Y3RUPPIU.js";import{a as B}from"./chunk-U254PV4S.js";import{b as $}from"./chunk-SQ6VENQY.js";import{a as T}from"./chunk-2DVVHNC3.js";import{a as x,b as R}from"./chunk-YO6DU7QZ.js";import{b as A}from"./chunk-I66MQD5U.js";import{b as E,c as P}from"./chunk-R3G6ERW7.js";import{a as L}from"./chunk-VHENVDS2.js";import{a as D}from"./chunk-EKP7XJ6L.js";import{e as C,f as H}from"./chunk-TQTVM27C.js";function y(e){let i=K(e),{breakdown:t}=Z(e),r=O(t,"risk"),n=O(t,"hygiene");return{score:Math.min(r,n),riskScore:r,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null},axes:Q(e),validation:X(e),suppressions:e.suppressions,actions:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Q(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:Y(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function Y(e){let i=e.gitEvidence?.fileStats;return i?e.complexity.top.map(t=>{let r=t.file?i[t.file]?.changes??0:0;return{...t,changes:r,weighted:p(t.score*Math.log2(1+r))}}).sort((t,r)=>r.weighted-t.weighted):null}function X(e){let i=e.gitEvidence?.fileStats;if(!i)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[]},r=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[f,d]of Object.entries(i))r.has(f)?n+=d.fixChanges:(o+=d.fixChanges,a+=1);let m=r.size>0?p(n/r.size):0,l=a>0?p(o/a):0,g={};for(let[f,d]of Object.entries(t)){let h=new Set(d);if(h.size===0)continue;let b=0;for(let q of h)b+=i[q]?.fixChanges??0;let w=p(b/h.size);g[f]={flaggedFiles:h.size,fixDensity:w,lift:l>0?p(w/l):null}}return{flaggedFiles:r.size,flaggedFixDensity:m,baselineFixDensity:l,ratio:r.size>0&&l>0?p(m/l):null,byCategory:g}}function p(e){return Math.round(e*100)/100}function K(e){let i=[];if(e.dead.count>0&&i.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&i.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&i.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&i.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.extractCount>0&&i.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&i.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&i.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),i.push({category:"Stale abstractions",evidence:"heuristic",description:`${n.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&n.push(`${e.drift.layerViolations} layer violations`),i.push({category:"Structural drift",evidence:"heuristic",description:n.join(", "),effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];i.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a dependency edge`+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},r={low:3,medium:2,high:1};return i.sort((n,o)=>{let a=t[n.impact]*r[n.effort];return t[o.impact]*r[o.effort]-a}),i}var J={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk",similar:"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene"};function O(e,i){let t=e.filter(r=>r.kind===i).reduce((r,n)=>r+n.points,0);return Math.max(0,Math.min(100,100-t))}function Z(e){let i=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),r=[],n=(d,h,b)=>{h>0&&r.push({axis:d,points:h,detail:b,kind:J[d]??"hygiene"})},o=e.dead.count/t;n("dead-code",Math.min(20,Math.round(o*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let a=e.isolated.count/t;n("isolated",Math.min(10,Math.round(a*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let m=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(m)),`${e.similarCount} similar function pair(s)`);let l=e.extractCount/t*1e3;n("extract",Math.min(5,Math.round(l/2)),`${e.extractCount} extraction candidate(s)`),n("wrappers",Math.min(3,e.wrappers.count),`${e.wrappers.count} wrapper candidate(s)`),n("passthroughs",Math.min(3,e.passthroughs.count),`${e.passthroughs.count} passthrough candidate(s)`);let g=e.stale.count/Math.max(t*.1,1);n("stale-abstractions",Math.min(8,Math.round(g*10)),`${e.stale.count} stale abstraction(s)`);let f=e.drift.count/i;return n("drift",Math.min(5,Math.round(f*50)),`${e.drift.count} drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence&&n("hidden-coupling",Math.min(5,e.gitEvidence.hiddenCoupling.pairCount),`${e.gitEvidence.hiddenCoupling.pairCount} co-changing pair(s) without a dependency edge`),{breakdown:r}}import{getHeapStatistics as ee}from"v8";var te=64*1024*1024;function S(){let e=globalThis.gc;if(!e)return;let i=ee();i.heap_size_limit-i.used_heap_size<te||e()}var ie=50,re=75e3,ne=5e3,V=2500,oe=["overview","dead","isolated","cycles","similar","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions"],N={overview:(e,i,t,r)=>({phase:"overview",statsResult:r,warnings:t.warnings}),dead:(e,i,t)=>({phase:"dead",dead:se(e,i,t)}),isolated:(e,i,t)=>({phase:"isolated",isolated:ce(e,i,t)}),cycles:(e,i,t)=>({phase:"cycles",realCycleCount:ue(e,i,t)}),similar:(e,i,t)=>({phase:"similar",similarCount:le(e,i,t)}),"extract-candidates":(e,i,t)=>({phase:"extract-candidates",extractCount:de(e,i,t)}),"wrapper-candidates":(e,i,t)=>({phase:"wrapper-candidates",wrappers:he(e,i,t)}),"passthrough-candidates":(e,i,t)=>({phase:"passthrough-candidates",passthroughs:pe(e,i,t)}),"stale-abstractions":(e,i,t)=>({phase:"stale-abstractions",stale:me(e,i,t)}),drift:(e,i,t)=>({phase:"drift",drift:be(e,i,t)}),"complexity-hotspots":(e,i,t)=>({phase:"complexity-hotspots",complexity:Ce(e,i,t)}),"git-evidence":(e,i,t)=>({phase:"git-evidence",gitEvidence:fe(e,t)}),suppressions:(e,i,t)=>({phase:"suppressions",suppressions:ge(e,t)})};function Ue(e,i={}){return G(e,i.full===!0,(t,r)=>{let n=ae(e,i.scope,t,r);return y(n)})}function qe(e,i,t={}){return G(e,t.full===!0,(r,n)=>N[i](e,t.scope,n,r))}function G(e,i,t){let r=k(e),n=He(r,i);try{return t(r,n)}finally{x(e,{semanticProvider:!0}),S()}}function Qe(e){return y(W(e))}function W(e){let i=s(e,"overview");return{statsResult:i.statsResult,warnings:i.warnings,dead:s(e,"dead").dead,isolated:s(e,"isolated").isolated,realCycleCount:s(e,"cycles").realCycleCount,similarCount:s(e,"similar").similarCount,extractCount:s(e,"extract-candidates").extractCount,wrappers:s(e,"wrapper-candidates").wrappers,passthroughs:s(e,"passthrough-candidates").passthroughs,stale:s(e,"stale-abstractions").stale,drift:s(e,"drift").drift,complexity:s(e,"complexity-hotspots").complexity,gitEvidence:j(e,"git-evidence")?.gitEvidence??null,suppressions:j(e,"suppressions")?.suppressions??null}}function j(e,i){return e.find(t=>t.phase===i)}function s(e,i){let t=e.find(r=>r.phase===i);if(!t)throw new Error(`Missing health phase result: ${i}`);return t}function ae(e,i,t,r){return W(oe.map(n=>N[n](e,i,r,t)))}function se(e,i,t){return c(e,t,"dead",()=>{let r=R(e,{scope:i,...u.dead,scanLimit:t.candidateScanLimit});return v(Se(e,r.symbols))})}function ce(e,i,t){return c(e,t,"isolated",()=>{let r=_(e,{scope:i,...u.isolated,scanLimit:t.candidateScanLimit});return v(ve(e,r))})}function ue(e,i,t){return c(e,t,"cycles",()=>D(e,{scope:i}).filter(n=>n.kind==="real").length)}function le(e,i,t){return c(e,t,"similar",()=>$(e,{scope:i,...u.similar,scanLimit:t.candidateScanLimit}).length)}function de(e,i,t){return c(e,t,"extract-candidates",()=>B(e,{scope:i,...u.extract,scanLimit:t.candidateScanLimit}).length)}function he(e,i,t){return U(e,t,"wrapper-candidates",()=>z(e,{scope:i,...u.wrappers,scanLimit:t.candidateScanLimit}))}function pe(e,i,t){return U(e,t,"passthrough-candidates",()=>M(e,{scope:i,...u.passthroughs,scanLimit:t.candidateScanLimit}))}function me(e,i,t){return c(e,t,"stale-abstractions",()=>{let r=F(e,{scope:i,...u.stale,scanLimit:t.candidateScanLimit}),n=r.filter(o=>o.consumers===0).length;return{count:r.length,loc:r.reduce((o,a)=>o+a.loc,0),files:[...new Set(r.map(o=>o.file))],unused:n,singleUse:r.length-n}})}function fe(e,i){return c(e,i,"git-evidence",()=>{let t=E(e);if(!t)return null;let r=A(e,void 0,{limit:50}),n={};for(let[o,a]of t)n[o]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:P(e),hiddenCoupling:{pairCount:r.findings.length,top:r.findings.slice(0,5).map(o=>({fileA:o.fileA,fileB:o.fileB,together:o.together,confidence:o.confidence}))},fileStats:n}})}function ge(e,i){return c(e,i,"suppressions",()=>{let t=I(e);return{total:t.total,byCategory:{...t.byCategory}}})}function be(e,i,t){return c(e,t,"drift",()=>{let r=T(e,{scope:i,...u.drift});return{count:r.unusedImports+r.layerViolations,unusedImports:r.unusedImports,layerViolations:r.layerViolations}})}function Ce(e,i,t){return c(e,t,"complexity-hotspots",()=>{let r=L(e,{scope:i,minLoc:10,limit:10,scanLimit:t.candidateScanLimit,semantic:!1});return{top:r.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:r.filter(n=>n.score>ie).length}})}function He(e,i){return e.symbols>=re||e.documents>=ne?i?{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:["Large index detected; running unbounded health analyses because --full was supplied."]}:{candidateScanLimit:V,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${V} symbols. Run "scip-query health --full" for unbounded candidate counts.`]}:{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:[]}}function xe(e,i){i.releaseCachesBetweenPhases&&(x(e),S())}function c(e,i,t,r){ye(t);try{return r()}finally{xe(e,i)}}function U(e,i,t,r){return c(e,i,t,()=>v(r()))}function ye(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function Se(e,i){return i.filter(t=>!C(e,t.relativePath)&&!H(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function ve(e,i){return i.filter(t=>!C(e,t.relativePath)&&!H(e,t.symbol,t.relativePath))}function v(e){let i=new Set;for(let t of e){let r=t.relativePath??t.file;r&&i.add(r)}return{count:e.length,loc:e.reduce((t,r)=>t+r.loc,0),files:[...i]}}export{oe as a,Ue as b,qe as c,Qe as d};
|
|
2
|
-
//# sourceMappingURL=chunk-NM3BZXHA.js.map
|
package/dist/chunk-NO2TPMCQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as R,e as T,f as k}from"./chunk-TQTVM27C.js";import{a as C}from"./chunk-RIXOMSOR.js";import{b as V,c as j,d as G}from"./chunk-EAU4RDFG.js";import{c as B}from"./chunk-PCMVXWDC.js";import{a as K,k as I,l as O}from"./chunk-6ZFKI5EP.js";import{c as M}from"./chunk-PBGTMPJ7.js";import{f as P,g as N,i as A,j as w,r as E,t as q}from"./chunk-SOGLYIJ4.js";import{b as h,c as m,d as v,f as x,k as b}from"./chunk-WQFOZIID.js";import{a as L}from"./chunk-NN3O7TPH.js";function H(i,e,t){let a=e.identifierResolution==="strict"?I:O;for(let n of e.paths)if(!(!m(n)&&!(e.includeVueSfc&&v(n)))&&!i.isIgnored(n)&&!e.skipPath?.(n))try{let l=(r,c,p,d)=>{if(e.candidateNames&&!e.candidateNames.has(r))return;let y=e.resolveTargets?e.resolveTargets({sourceFile:n,name:r,kind:c,defaultTargets:d}):d();for(let S of y)t({sourceFile:n,name:r,target:S,occurrences:p,kind:c})},f=K(i,n);for(let[r,c]of f)l(r,"identifier",c.length,()=>a(i,n,r));for(let r of b(i,n,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let c=r.kind==="cross-language-dispatch"?()=>I(i,n,r.name):()=>a(i,n,r.name);l(r.name,r.kind,r.occurrences,c)}}finally{e.afterPath?.(n)}}var W=class{constructor(e){this.db=e}db;scopedDefinitions(e){return q(this.db,e)}definitionsForFile(e){return E(this.db,e)}productionCallableDefinitions(e={}){let{scope:t,minLoc:a=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:l=!1,excludeTypesFiles:f=!1,excludeRootedSymbols:r=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:p=!1,excludeRustTraitImplMembers:d=!1,includeSuppressed:y=!1,sortByLocDesc:S=!1}=e,g=[];for(let s of this.scopedDefinitions(t)){let u=s.relativePath;if(this.db.isIgnored(u)||l&&T(this.db,u)||!Y(s,{requireFunctionLikeSymbol:c,requireCallableSymbol:p})||o!==void 0&&s.symbol===o)continue;let F=D(s);F<a||F>n||f&&_(u)||r&&k(this.db,s.symbol,u)||d&&A(s.symbol)||R(u)!=="test"&&(w(s.symbol)||!y&&h(this.db,u,s.startLine)||g.push(s))}return S?g.sort((s,u)=>D(u)-D(s)):g}calleeMap(e,t={}){return B(this.db,e,t)}crossFileCallerMap(e,t={}){return V(this.db,e,t)}sourceFallbackCallerFiles(e){return j(this.db,e)}callerFileMap(e,t={}){return G(this.db,e,t)}frameworkReferencedSymbolIds(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let o=t.get(n.leaf)??[];o.push(n.symbolId),t.set(n.leaf,o)}let a=new Set;for(let n of L(this.db,{includeIgnored:!1}))if(m(n)==="rust")for(let{name:o}of b(this.db,n,{includeRustAttributeNames:!0}))for(let l of t.get(o)??[])a.add(l);return a}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let a=new Map(e.map(o=>[o.symbolId,o.symbol])),n=this.calleeMap(e,t);return new Set([...n.entries()].filter(([o,l])=>{let f=a.get(o);return l.some(r=>r.symbol!==f)}).map(([o])=>o))}fileDependencyGraph(e){return C(this.db,e)}fileKind(e){return R(e)}hasSuppressionComment(e){return h(this.db,e.relativePath,e.startLine)}sourceFiles(){return M(this.db)}scanSourceReferences(e,t){H(this.db,e,t)}callableSignature(e){let t=x(this.db,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};function Y(i,e){return e.requireCallableSymbol?P(i.symbol):e.requireFunctionLikeSymbol?N(i.symbol):i.isFunctionLike}function D(i){return i.endLine-i.startLine+1}function _(i){return(i.split("/").pop()??"").includes("types")}export{W as a};
|
|
2
|
-
//# sourceMappingURL=chunk-NO2TPMCQ.js.map
|
package/dist/chunk-OMNT7E2T.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as h,b as F,c as w}from"./chunk-CVRXOP6M.js";import{a as M}from"./chunk-V76FCF5F.js";import{a as b}from"./chunk-MX6F756F.js";import{a as P}from"./chunk-NO2TPMCQ.js";import{a as S,f as D}from"./chunk-TQTVM27C.js";import{a as L,c as v,d as p}from"./chunk-SOGLYIJ4.js";import{a as y,j as I}from"./chunk-WQFOZIID.js";function ie(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:l=!1,scanLimit:a}=e??{},f=e?.semantic!==!1,o=new P(t),d=o.scopedDefinitions(n),g=V(o,n),x={high:0,medium:1,low:2};return M({candidates:()=>$(t,o,d,{minLoc:i,maxLoc:s}),orderCandidates:(c,u)=>b(u)-b(c)||c.relativePath.localeCompare(u.relativePath),scanLimit:a,prepare:c=>({consumerFileMap:A(o,c,{semantic:f}),singletonBackedClassIds:O(t,o,d,c,{semantic:f}),candidateIndex:B(c)}),evaluate:(c,u)=>{if(u.singletonBackedClassIds.has(c.symbolId))return null;let m=N(t,c,u.consumerFileMap,u.candidateIndex);if(m.transitivelyReachable||m.realConsumers.length>1||m.realConsumers.length===0&&m.barrelConsumers>0||!Z(m.definition,m.realConsumers.length,g))return null;let C=j(t,m);return!l&&C.confidence==="low"?null:C},orderResults:(c,u)=>x[c.confidence]-x[u.confidence]||u.loc-c.loc||c.file.localeCompare(u.file)||c.startLine-u.startLine,limit:r})}function $(t,e,n,i){return n.filter(s=>s.isTypeLike&&b(s)>=i.minLoc).filter(s=>b(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>S(s.relativePath)!=="test").filter(s=>!D(t,s.symbol,s.relativePath)).filter(s=>!H(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function A(t,e,n){return h(t,e,{semantic:n.semantic})}function B(t){let e=new Map;for(let n of t){let i=e.get(n.relativePath);i||(i=new Map,e.set(n.relativePath,i));let s=p(n.symbol);s&&i.set(s,n)}return e}function N(t,e,n,i){let r=[...n.get(e.symbolId)??new Set].filter(d=>d!==e.relativePath&&!t.isIgnored(d)),{realConsumers:l,barrelConsumers:a,importOnlyConsumers:f}=F(t,e,r),o=_(t,e,n,i);return{definition:e,realConsumers:l,barrelConsumers:a+f,transitivelyReachable:o}}function j(t,e){let n=k(t,e.definition.relativePath,e.definition.startLine),i=T(e.definition.relativePath)?!0:q(t,e.definition),{confidence:s,reason:r}=G(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:v(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:b(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:i,confidence:s,reason:r}}function O(t,e,n,i,s){let r=W(t,U(n),i),l=r.map(o=>o.singleton);if(r.length===0)return new Set;let a=h(e,l,{semantic:s.semantic}),f=new Set;for(let{singleton:o,classId:d}of r)E(t,o,a)&&f.add(d);return f}function U(t){let e=new Map;for(let n of t){let i=p(n.symbol);i&&e.set(R(n.relativePath,i),n)}return e}function W(t,e,n){let i=[];for(let s of n){let r=z(t,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function z(t,e,n){if(k(t,n.relativePath,n.startLine)!=="class")return null;let i=p(n.symbol);if(!i)return null;let s=K(t,n.relativePath,i);return s?e.get(R(n.relativePath,s))??null:null}function E(t,e,n){let i=p(e.symbol),s=n.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!w(t,r,i))}function R(t,e){return`${t}\0${e}`}function K(t,e,n){let i=y(t,e);if(!i)return null;let s=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return i.match(r)?.[1]??null}function V(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function H(t){let e=L(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let i=n[n.length-1],s=n[n.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function T(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function Z(t,e,n){return!(T(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function _(t,e,n,i){let s=I(t,e.relativePath),r=p(e.symbol);if(!r)return!1;let l=s.get(r);if(!l||l.size===0)return!1;let a=i.get(e.relativePath);if(!a)return!1;for(let f of l){let o=a.get(f);if(!o)continue;let d=n.get(o.symbolId);if(d){for(let g of d)if(g!==e.relativePath&&!t.isIgnored(g))return!0}}return!1}function k(t,e,n){let i=y(t,e);if(!i)return"other";let s=i.split(`
|
|
2
|
-
`),r=Math.max(0,n-2),l=Math.min(s.length-1,n+2);for(let a=r;a<=l;a++){let o=(s[a]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(o))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(o))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(o))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(o))return"enum"}return"other"}function q(t,e){let n=y(t,e.relativePath);if(!n)return!1;let i=p(e.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),l=n.split(`
|
|
3
|
-
`);for(let a=0;a<l.length;a++)if(!(a>=e.startLine&&a<=e.endLine)&&r.test(l[a]??""))return!0;return!1}function G(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{ie as a};
|
|
4
|
-
//# sourceMappingURL=chunk-OMNT7E2T.js.map
|
package/dist/chunk-PBGTMPJ7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-NN3O7TPH.js";import{c as d}from"./chunk-VDZL45XI.js";import{readdirSync as x}from"fs";import{extname as p,join as f}from"path";var m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],j=[".vue"],S=new Set(m.map(t=>t.toLowerCase())),g=[...S].sort().join(","),y=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function w(t,o={}){let s=o.includeIndexed??!0,i=o.includeAuxiliary??!0,e=o.extensions?.map(c=>c.toLowerCase()),r=e?new Set(e):S,u=e?[...r].sort().join(","):g,n=`${s?"1":"0"}|${i?"1":"0"}|${u}`;return h.get(t,n,()=>{let c=new Set;if(s)for(let a of l(t,{includeIgnored:!1}))r.has(p(a).toLowerCase())&&c.add(a);if(i)for(let a of E(t.config.projectRoot,r))t.isIgnored(a)||c.add(a);return[...c].sort()})}var h=d("source-files",{clearGroups:[]});function E(t,o){let s=new Set,i=e=>{let r=e?f(t,e):t,u;try{u=x(r,{withFileTypes:!0})}catch{return}for(let n of u)if(!y.has(n.name)){if(n.isDirectory()){i(e?`${e}/${n.name}`:n.name);continue}o.has(p(n.name).toLowerCase())&&s.add(e?`${e}/${n.name}`:n.name)}};return i(""),s}export{j as a,y as b,w as c};
|
|
2
|
-
//# sourceMappingURL=chunk-PBGTMPJ7.js.map
|
package/dist/chunk-PCMVXWDC.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{b as k,g as v,h as O,i as D,n as F}from"./chunk-6ZFKI5EP.js";import{c as N,e as T}from"./chunk-64UY7VTR.js";import{d as M,f as w,r as L,s as I,v as A}from"./chunk-SOGLYIJ4.js";import{c as E,i as C}from"./chunk-WQFOZIID.js";import{d as R}from"./chunk-VDZL45XI.js";function le(e,n,o={}){let l=x(e,[n],{additive:o.additive,semantic:o.semantic}),i=o.callableOnly?(l.get(n.symbolId)??[]).filter(a=>w(a.symbol)):l.get(n.symbolId)??[];return typeof o.limit=="number"?i.slice(0,o.limit):i}function ie(e,n,o={}){let l=G(e)?W(e,n,{semantic:o.semantic!==!1}):J(e).get(n.symbolId)??[];return typeof o.limit=="number"?l.slice(0,o.limit):l}var H=R("caller-rows",{clearGroups:["whole-project"]}),$=2e4;function G(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>$}function J(e){return H.get(e,()=>{let n=I(e),o=x(e,n),l=new Map;for(let c of n)l.set(c.symbol,c.symbolId);let i=new Map,a=new Map;for(let c of n){let s=o.get(c.symbolId);if(!(!s||s.length===0))for(let d of s){let t=l.get(d.symbol);if(t===void 0||t===c.symbolId)continue;let r=i.get(t);r||(r=[],i.set(t,r),a.set(t,new Set));let f=`${c.symbol}|${c.relativePath}`;a.get(t).has(f)||(a.get(t).add(f),r.push({symbol:c.symbol,file:c.relativePath,source:"caller-map-inversion"}))}}return i})}function W(e,n,o){let l=[],i=new Set,a=s=>{if(s.symbol===n.symbol)return;let d=`${s.symbol}|${s.file}`;i.has(d)||(i.add(d),l.push(s))};for(let s of F(e,n))s.file!==n.relativePath&&a({symbol:s.enclosingSymbol??s.file,file:s.file,source:"resolved-reference"});let c=o.semantic?B(e,n):null;if(c)for(let s of N(e,c)){if(s.file===n.relativePath||e.isIgnored(s.file))continue;let d=A(L(e,s.file),s.line);a({symbol:d?.symbol??s.file,file:s.file,source:"semantic-reference"})}return l}function B(e,n){return e.get(`SELECT
|
|
2
|
-
d.id AS documentId,
|
|
3
|
-
gs.id AS symbolId,
|
|
4
|
-
gs.symbol,
|
|
5
|
-
d.relative_path AS relativePath,
|
|
6
|
-
COALESCE(der.start_line, c.start_line) AS startLine,
|
|
7
|
-
COALESCE(der.end_line, c.end_line) AS endLine,
|
|
8
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
9
|
-
NULL AS parentTypeName,
|
|
10
|
-
CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
11
|
-
CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
|
|
12
|
-
gs.kind AS kind,
|
|
13
|
-
gs.documentation AS documentation,
|
|
14
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
15
|
-
FROM global_symbols gs
|
|
16
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
17
|
-
LEFT JOIN chunks c ON c.document_id = der.document_id
|
|
18
|
-
JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
|
|
19
|
-
WHERE gs.id = ?
|
|
20
|
-
LIMIT 1`,n.symbolId)??null}function x(e,n,o={}){if(n.length===0)return new Map;let l=o.additive??!1,i=[],a=[];for(let r of n)E(r.relativePath)&&C(e,r.relativePath)!==null?i.push(r):a.push(r);let c=new Map,s=new Map,d=r=>{for(let[f,p]of r){let b=c.get(f);b||(b=[],c.set(f,b));let y=s.get(f);y||(y=new Set,s.set(f,y));for(let m of p){let u=`${m.symbol}|${m.chunkId}`;y.has(u)||(y.add(u),b.push(m))}}};i.length>0&&d(j(e,i)),o.semantic!==!1&&d(q(T(e,n)));let t=l?n:a;return t.length>0&&d(Y(e,t)),c}function j(e,n){let o=new Map,l=U(n,o),i=D(e);for(let[a,c]of l){let s=C(e,a);if(s)for(let d of s){let t=K(c,d.line);if(!t)continue;let r=V(e,a,i,d.calleeLeaf,d.memberAccess);r&&r.symbol!==t.symbol&&o.get(t.symbolId).push({symbol:r.symbol,file:r.file,chunkId:d.line,source:"ast-callsite"})}}return o}function U(e,n){let o=new Map;for(let l of e){let i=o.get(l.relativePath);i?i.push(l):o.set(l.relativePath,[l]),n.set(l.symbolId,[])}for(let l of o.values())l.sort((i,a)=>i.endLine-i.startLine-(a.endLine-a.startLine));return o}function K(e,n){return e.find(o=>n>=o.startLine&&n<=o.endLine)??null}function V(e,n,o,l,i){let a=v(n,o.get(l)??[]);return a.length===0?null:O(e,n,a,i)}function Y(e,n){if(n.length===0)return new Map;let o=e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
|
|
21
|
-
FROM mentions m
|
|
22
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
23
|
-
WHERE m.role != 1`),l=new Map;for(let t of o)l.has(t.document_id)||l.set(t.document_id,[]),l.get(t.document_id).push(t);let i=new Map(e.all("SELECT id, relative_path FROM documents").map(t=>[t.id,t.relative_path])),a=new Map,c=e.all(`SELECT gs.id AS symbol_id, gs.symbol,
|
|
24
|
-
COALESCE(der.document_id, def_chunk.document_id) AS document_id
|
|
25
|
-
FROM global_symbols gs
|
|
26
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
27
|
-
LEFT JOIN (
|
|
28
|
-
SELECT m.symbol_id, MIN(c.document_id) AS document_id
|
|
29
|
-
FROM mentions m
|
|
30
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
31
|
-
WHERE m.role = 1
|
|
32
|
-
GROUP BY m.symbol_id
|
|
33
|
-
) def_chunk ON def_chunk.symbol_id = gs.id`);for(let t of c)a.has(t.symbol_id)||a.set(t.symbol_id,{symbol:t.symbol,file:t.document_id!==null?i.get(t.document_id)??"":""});let s=new Map,d=i;for(let t of n){let r=l.get(t.documentId)??[],f=new Set,p=[],b=null,y=()=>{if(b)return b;let m=d.get(t.documentId)??"",u=new Set;if(m){let h=k(e,m),S=Math.max(0,t.startLine),_=Math.min(h.length-1,t.endLine);for(let g=S;g<=_;g+=1)for(let P of h[g])u.add(P)}return b=u,u};for(let m of r){if(m.symbol_id===t.symbolId)continue;let u=a.get(m.symbol_id);if(!u)continue;if(!(m.start_line>=t.startLine&&m.end_line<=t.endLine)){if(!(m.start_line<=t.endLine&&m.end_line>=t.startLine))continue;let g=M(u.symbol);if(!g||!y().has(g))continue}let S=`${u.symbol}|${m.chunk_id}`;f.has(S)||(f.add(S),p.push({...u,chunkId:m.chunk_id,source:"scip-chunk"}))}s.set(t.symbolId,p)}return s}function q(e){let n=new Map;for(let[o,l]of e){let i=[];for(let a of l)i.push({symbol:a.symbol,file:a.file,chunkId:-1,source:"semantic-callee"});n.set(o,i)}return n}export{le as a,ie as b,x as c};
|
|
34
|
-
//# sourceMappingURL=chunk-PCMVXWDC.js.map
|
package/dist/chunk-PLFYFZX3.js
DELETED
package/dist/chunk-R3G6ERW7.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{d as b}from"./chunk-VDZL45XI.js";import{execFileSync as y}from"child_process";var A=2e3,F=50,R=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i;function d(e){let n=b(e,{clearGroups:["whole-project"]});return(t,i)=>{let s=M(t.config.projectRoot);if(!s)return null;let r=n.has(t)?n.get(t,()=>({head:"",value:null})):null;return r&&r.head===s?r.value:(n.invalidate(t),n.get(t,()=>({head:s,value:i(t.config.projectRoot,s)})).value)}}var S=d("git-commit-history");function p(e){return S(e,w)}function M(e){try{return g(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function g(e,n){return y("git",["-C",e,...n],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function w(e,n){let t;try{t=g(e,["log","--no-merges","--name-only","-n",String(A),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let i=[],s=0;for(let r of t.split("")){if(r.trim()==="")continue;let c=r.indexOf(`
|
|
2
|
-
`),f=c>=0?r.slice(0,c):r,[a,o,l]=f.split("\0");if(!a||!o)continue;let m=c>=0?r.slice(c+1).split(`
|
|
3
|
-
`).map(u=>u.trim()).filter(u=>u!==""):[];if(m.length>F){s+=1;continue}i.push({hash:a,timestamp:Number(o)||0,subject:l??"",files:m})}return{head:n,commits:i,skippedBulkCommits:s}}function k(e){return R.test(e.subject)}function B(e){let n=p(e);if(!n)return null;let t=new Map;for(let i of n.commits){let s=k(i);for(let r of i.files){let c=t.get(r)??{changes:0,fixChanges:0,lastChangedAt:0};c.changes+=1,s&&(c.fixChanges+=1),i.timestamp>c.lastChangedAt&&(c.lastChangedAt=i.timestamp),t.set(r,c)}}return t}function v(e){let n=p(e);if(!n||n.commits.length===0)return null;let t=n.commits.map(i=>i.files.length).filter(i=>i>0).sort((i,s)=>i-s);return t.length===0?null:{medianFilesPerCommit:x(t,.5),p90FilesPerCommit:x(t,.9),commitsAnalyzed:t.length}}function x(e,n){let t=Math.min(e.length-1,Math.floor(e.length*n));return e[t]}var P=d("git-tracked-files");function _(e){return P(e,n=>{try{let t=g(n,["ls-files"]);return new Set(t.split(`
|
|
4
|
-
`).map(i=>i.trim()).filter(i=>i!==""))}catch{return null}})}var T=d("git-file-adds");function E(e){return T(e,n=>j(n))}function j(e){let n;try{n=g(e,["log","--no-merges","--diff-filter=A","--name-only","-n",String(A),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let t=new Map,i=-1;for(let s of n.split("")){if(s.trim()==="")continue;i+=1;let r=s.indexOf(`
|
|
5
|
-
`),c=r>=0?s.slice(0,r):s,[,f]=c.split("\0"),a=Number(f)||0;if(!(r<0))for(let o of s.slice(r+1).split(`
|
|
6
|
-
`)){let l=o.trim();l!==""&&t.set(l,{commitsAgo:i,addedAt:a})}}return t}function I(e,n={}){let{minTogether:t=4,minConfidence:i=.6}=n,s=p(e);if(!s)return null;let r=new Map,c=new Map;for(let a of s.commits){let o=[...new Set(a.files)].sort();for(let l of o)r.set(l,(r.get(l)??0)+1);for(let l=0;l<o.length;l++)for(let m=l+1;m<o.length;m++){let u=`${o[l]}\0${o[m]}`;c.set(u,(c.get(u)??0)+1)}}let f=[];for(let[a,o]of c){if(o<t)continue;let[l,m]=a.split("\0"),u=r.get(l)??o,h=r.get(m)??o,C=Math.max(o/u,o/h);C<i||f.push({fileA:l,fileB:m,together:o,confidence:C,changesA:u,changesB:h})}return f.sort((a,o)=>o.together-a.together||o.confidence-a.confidence||a.fileA.localeCompare(o.fileA)),f}export{p as a,B as b,v as c,_ as d,E as e,I as f};
|
|
7
|
-
//# sourceMappingURL=chunk-R3G6ERW7.js.map
|
package/dist/chunk-SEZZ24IG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b}from"./chunk-SQ6VENQY.js";import{e as d}from"./chunk-R3G6ERW7.js";function C(m,r={}){let{windowCommits:a=100,minSimilarity:u=.7,limit:c=30,scope:g,scanLimit:f}=r,o=d(m);if(!o)return{available:!1,windowCommits:a,findings:[]};let A=b(m,{scope:g,minSimilarity:u,limit:c*5,crossFileOnly:!0,scanLimit:f,semantic:r.semantic}),n=[];for(let e of A){let i=o.get(e.fileA)?.commitsAgo??null,t=o.get(e.fileB)?.commitsAgo??null,s=i!==null&&i<=a,h=t!==null&&t<=a;if(!(!s&&!h)){if(s&&h){let l=(i??0)<=(t??0);n.push({kind:"twin",echoSymbol:l?e.shortNameA:e.shortNameB,echoFile:l?e.fileA:e.fileB,echoAgeCommits:(l?i:t)??0,establishedSymbol:l?e.shortNameB:e.shortNameA,establishedFile:l?e.fileB:e.fileA,establishedAgeCommits:l?t:i,similarity:e.similarity,sharedCallees:e.sharedCallees})}else n.push({kind:"echo",echoSymbol:s?e.shortNameA:e.shortNameB,echoFile:s?e.fileA:e.fileB,echoAgeCommits:(s?i:t)??0,establishedSymbol:s?e.shortNameB:e.shortNameA,establishedFile:s?e.fileB:e.fileA,establishedAgeCommits:s?t:i,similarity:e.similarity,sharedCallees:e.sharedCallees});if(n.length>=c)break}}return n.sort((e,i)=>(e.kind===i.kind?0:e.kind==="echo"?-1:1)||i.similarity-e.similarity),{available:!0,windowCommits:a,findings:n}}export{C as a};
|
|
2
|
-
//# sourceMappingURL=chunk-SEZZ24IG.js.map
|
package/dist/chunk-SLX5XBCD.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as D,b as L}from"./chunk-CVRXOP6M.js";import{a as M}from"./chunk-V76FCF5F.js";import{a as C,b as F}from"./chunk-MX6F756F.js";import{a as I}from"./chunk-NO2TPMCQ.js";import{a as b}from"./chunk-6ZFKI5EP.js";import{c as m,d,j as p,v as g}from"./chunk-SOGLYIJ4.js";import{basename as u,extname as f}from"path";function q(t,n){let{scope:e,maxLoc:r=15,limit:o=30,scanLimit:a}=n??{},i=new I(t),s=k(i.fileDependencyGraph(e));return M({candidates:()=>x(i,e,r),orderCandidates:F,scanLimit:a,prepare:l=>({callerFileMap:D(i,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,c)=>h(t,i,l,c),orderResults:(l,c)=>c.callerFanIn-l.callerFanIn||c.loc-l.loc,limit:o})}function h(t,n,e,r){let o=S(t,n,e,r.callerFileMap);if(o.length!==1)return null;let a=o[0],i=y(t,e.symbolId,a);if(!i)return null;let s=v(n,t,a,e.symbol,i);if(s&&p(s.symbol))return null;let{fanIn:l,source:c}=P(r.callerFileMap,r.reverseFanIn,a,s);return(c==="function"?l<=3:l<=5)?null:{symbol:e.symbol,shortName:m(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:C(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?m(s.symbol):u(a),callerFanIn:l}}function x(t,n,e){return t.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0})}function S(t,n,e,r){let o=u(e.relativePath,f(e.relativePath)),a=[...r.get(e.symbolId)??[]].filter(i=>i!==e.relativePath).filter(i=>u(i,f(i))!==o).filter(i=>{let s=n.fileKind(i);return s!=="barrel"&&s!=="entry"&&s!=="test"});return L(t,e,a).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,o){let a=t.definitionsForFile(e),i=_(n,e,r,o.start_line,o.end_line);return g(a,i)}function P(t,n,e,r){if(r?.isFunctionLike){let o=[...t.get(r.symbolId)??[]].filter(a=>a!==r.relativePath);if(o.length>0)return{fanIn:o.length,source:"function"}}return{fanIn:N(n,e),source:"file"}}function _(t,n,e,r,o){let a=d(e);if(!a)return r;let i=b(t,n).get(a);if(!i||i.length===0)return r;for(let s of i)if(s>=r&&s<=o)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 o of r)n.set(o,(n.get(o)??0)+1)}return n}function N(t,n){let e=t.get(n)??0;if(e>0)return e;let r=u(n,f(n)),o=0;for(let[a,i]of t)a!==n&&u(a,f(a))===r&&i>o&&(o=i);return o}export{q as a};
|
|
7
|
-
//# sourceMappingURL=chunk-SLX5XBCD.js.map
|