diff --git a/gitnexus-web/src/lib/constants.ts b/gitnexus-web/src/lib/constants.ts index f6804405b..51e0af08c 100644 --- a/gitnexus-web/src/lib/constants.ts +++ b/gitnexus-web/src/lib/constants.ts @@ -38,6 +38,7 @@ export const NODE_COLORS: Record = { Template: '#a78bfa', // Violet light - like Type Route: '#f43f5e', // Rose - like Process Tool: '#a855f7', // Purple - like Project + Webhook: '#06b6d4', // Cyan - event/integration handler }; // Node sizes by type - clear visual hierarchy with dramatic size differences @@ -79,6 +80,7 @@ export const NODE_SIZES: Record = { Template: 3, // Like Type Route: 5, // Like Enum Tool: 5, // Like Enum + Webhook: 5, // Like Enum - event handler }; // Community color palette for cluster-based coloring diff --git a/gitnexus/CHANGELOG.md b/gitnexus/CHANGELOG.md index 80096345d..8d8b5ed90 100644 --- a/gitnexus/CHANGELOG.md +++ b/gitnexus/CHANGELOG.md @@ -80,17 +80,20 @@ All notable changes to GitNexus will be documented in this file. ## [1.5.2] - 2026-04-01 ### Fixed + - **`gitnexus-shared` module not found** — `gitnexus-shared` was a `file:` workspace dependency never published to npm, causing `ERR_MODULE_NOT_FOUND` when installing `gitnexus` globally. The build now bundles shared code into `dist/_shared/` and rewrites imports to relative paths (#613) - **v1.5.1 publish regression** — npm's `prepare` lifecycle ran `tsc` after `prepack`, overwriting the rewritten imports before packing; both scripts now run the full build so the final tarball is always correct ## [1.5.1] - 2026-04-01 [YANKED] ### Fixed + - Incomplete fix for `gitnexus-shared` bundling — `prepare` script overwrote rewritten imports during publish ## [1.5.0] - 2026-04-01 ### Added + - **Repo landing screen** — when the backend detects indexed repositories, the web UI now shows a landing page with selectable repo cards (name, stats, indexed date) instead of auto-loading the first repo; users can also analyze new repos directly from the landing screen (#607) - **Unified web & CLI ingestion pipeline** — complete architectural migration of the web app from a self-contained WASM browser app to a thin client backed by the CLI server; new `gitnexus-shared` package for cross-package type unification (#536) - New server endpoints: `/api/heartbeat` (SSE liveness), `/api/info`, `/api/repos`, `/api/file`, `/api/grep`, `/api/analyze` (SSE progress), `/api/embed`, `/api/mcp` (MCP-over-StreamableHTTP) @@ -106,19 +109,23 @@ All notable changes to GitNexus will be documented in this file. - **ESLint v9** — flat config with `unused-imports` auto-removal, `@typescript-eslint` rules, React hooks rules, CI `lint` job (#564) ### Fixed + - **OpenCode MCP configuration** — corrected README MCP setup for OpenCode which requires `command` as an array containing both executable and arguments (#363) - **litellm security** — excluded vulnerable versions 1.82.7 and 1.82.8 in eval harness `pyproject.toml` (#580) ### Changed + - **Reduced explicit `any` types** — 128 `no-explicit-any` warnings eliminated (689 → 561, 19% reduction) across `NodeProperties` index signature, ~80 `SyntaxNode` substitutions, typed worker protocol, and graphology community detection (#566) ### Docs + - Added `gitnexus-shared` build step to web UI quick start instructions (#585) - Added enterprise offering section to README (#579) ## [1.4.10] - 2026-03-27 ### Fixed + - **MCP server install via npx** — resolve tree-sitter peer dependency conflicts that broke `npx -y gitnexus@latest mcp` (#537, #538) - Downgrade tree-sitter from ^0.25.0 to ^0.21.1 (only npm version where all 14 parsers agree) - Align all parser versions to their highest ^0.21.x-compatible releases @@ -129,6 +136,7 @@ All notable changes to GitNexus will be documented in this file. ## [1.4.9] - 2026-03-26 ### Added + - **COBOL language support** — standalone regex processor for fixed-format and free-format COBOL, JCL, COPY/REPLACING with pseudotext (#498) - 95% language feature coverage: CALL USING, EXEC SQL/CICS/DLI, DECLARATIVES, SET, INSPECT, INITIALIZE, STRING/UNSTRING, SORT/MERGE with INPUT/OUTPUT PROCEDURE, GO TO DEPENDING ON, MOVE CORRESPONDING, nested programs with per-program scoping - 90+ review findings resolved across 20 review cycles with 241 tests (180 unit + 61 integration) @@ -145,11 +153,13 @@ All notable changes to GitNexus will be documented in this file. - **Filter panel** — additional node types (#519) ### Changed + - **BUILT_IN_NAMES** split into per-language provider fields (#523) - **tree-sitter** upgraded to 0.25.0 with all grammar packages (#516) - **Impact tool** — batched chunking and entry-point grouping for enrichment (#507) ### Fixed + - **COBOL CRLF** — all `split('\n')` calls use `/\r?\n/` for Windows compatibility - **COBOL nested programs** — all graph edges (CALL, CANCEL, CICS, ENTRY, SQL, SEARCH) use `owningModuleId()` for correct attribution - **COBOL callAccum** — multi-line CALL USING with verb boundary detection, Area A paragraph guard, EXEC entry flush, division/END PROGRAM flush @@ -162,6 +172,7 @@ All notable changes to GitNexus will be documented in this file. ## [1.4.8] - 2026-03-23 ### Added + - **Type resolution Milestone D — Phases 10–13** consolidated into a single milestone with full integration test coverage across 11 languages (#387) - Phase A/B/C: overload disambiguation via argument literal types, constructor-visible virtual dispatch via `constructorTypeMap`, `parameterTypes` extraction in `extractMethodSignature` - Phase 14 enhancements: single-pass seeding, Tarjan's SCC for cyclic resolution, cross-file return types @@ -180,6 +191,7 @@ All notable changes to GitNexus will be documented in this file. - **Pre-commit hooks** via husky for typecheck + unit tests ### Fixed + - **Python import alias resolution** — `import X as Y` now routes module aliases directly to `moduleAliasMap` in import processor (#417, #461) - **Python module-qualified calls** resolved via `moduleAliasMap` (#337) - **Python module-qualified constructor calls** (Issue #337) @@ -201,17 +213,20 @@ All notable changes to GitNexus will be documented in this file. - **package-lock.json** synced with `onnxruntime-node ^1.24.0` ### Changed + - **Unified language dispatch** with compile-time exhaustive tables - **Prepare script simplified** — removed `scripts/prepare.cjs` - **Switched from .githooks to husky** for pre-commit hooks - **`@claude` workflow** restricted to maintainers and above via `author_association` check ### Performance + - **O(1) per-chunk synthesis guard** using `boolean[]` instead of Set - **`sizeBefore` optimization** in type resolution - **Token truncation** improvements ### Chore + - Strengthened Python module-import tests, un-skipped match/case, added perf guard - Added positive and negative tests for all 4 bug fixes - E2e tests for stale detection, sequential enrichment, stability (#396) @@ -222,6 +237,7 @@ All notable changes to GitNexus will be documented in this file. ## [1.4.7] - 2026-03-19 ### Added + - **Phase 8 field/property type resolution** — ACCESSES edges with `declaredType` for field reads/writes (#354) - **Phase 9 return-type variable binding** — call-result variable binding across 11 languages (#379) - `extractPendingAssignment` in per-language type extractors captures `let x = getUser()` patterns @@ -235,6 +251,7 @@ All notable changes to GitNexus will be documented in this file. - **MCP tool/resource descriptions** updated to reflect Phase 9 ACCESSES edge semantics and `declaredType` property ### Fixed + - **mcp**: server crashes under parallel tool calls (#326, #349) - **parsing**: undefined error on languages missing from call routers (#364) - **web**: add missing Kotlin entries to `Record` maps @@ -243,12 +260,14 @@ All notable changes to GitNexus will be documented in this file. - **docs**: corrected stale "single-pass" claims in type-resolution-system.md to reflect walk+fixpoint architecture ### Changed + - **Upgrade `@ladybugdb/core` to 0.15.2** and remove segfault workarounds (#374) - **type-resolution-roadmap.md** overhauled — completed phases condensed to summaries, Phases 10–14 added with full engineering specs ## [1.4.6] - 2026-03-18 ### Added + - **Phase 7 type resolution** — return-aware loop inference for call-expression iterables (#341) - `ReturnTypeLookup` interface with `lookupReturnType` / `lookupRawReturnType` split - `ForLoopExtractorContext` context object replacing positional `(node, env)` signature @@ -261,6 +280,7 @@ All notable changes to GitNexus will be documented in this file. - `pendingCallResults` infrastructure (dormant — Phase 9 work) ### Fixed + - **impact**: return structured error + partial results instead of crashing (#345) - **impact**: add `HAS_METHOD` and `OVERRIDES` to `VALID_RELATION_TYPES` (#350) - **cli**: write tool output to stdout via fd 1 instead of stderr (#346) @@ -271,11 +291,13 @@ All notable changes to GitNexus will be documented in this file. - **docs**: correct `pendingCallResults` description in roadmap and system docs ### Chore + - Add `.worktrees/` to `.gitignore` ## [1.4.5] - 2026-03-17 ### Added + - **Ruby language support** for CLI and web (#111) - **TypeEnvironment API** with constructor inference, self/this/super resolution (#274) - **Return type inference** with doc-comment parsing (JSDoc, PHPDoc, YARD) and per-language type extractors (#284) @@ -297,10 +319,12 @@ All notable changes to GitNexus will be documented in this file. - `hookTimeout: 120000` in vitest config for CI beforeAll hooks ### Changed + - **Migrated from KuzuDB to LadybugDB v0.15** (#275) - Dynamically discover and install agent skills in CLI (#270) ### Performance + - Worker pool threshold — skip worker creation for small repos (<15 files or <512KB total) - AST walk pruning via `SKIP_SUBTREE_TYPES` for leaf-only nodes (string, comment, number literals) - Pre-computed `interestingNodeTypes` set — single Set.has() replaces 3 checks per AST node @@ -308,6 +332,7 @@ All notable changes to GitNexus will be documented in this file. - Replace `.children?.find()` with manual for loops in `extractFunctionName` to eliminate array allocations ### Fixed + - Same-directory Python import resolution (#328) - Ruby method-level call resolution, HAS_METHOD edges, and dispatch table (#278) - C++ fixture file casing for case-sensitive CI diff --git a/gitnexus/README.md b/gitnexus/README.md index ed27bf728..150276140 100644 --- a/gitnexus/README.md +++ b/gitnexus/README.md @@ -30,20 +30,20 @@ To configure MCP for your editor, run `npx gitnexus setup` once — or set it up ### Editor Support -| Editor | MCP | Skills | Hooks (auto-augment) | Support | -|--------|-----|--------|---------------------|---------| -| **Claude Code** | Yes | Yes | Yes (PreToolUse) | **Full** | -| **Cursor** | Yes | Yes | — | MCP + Skills | -| **Codex** | Yes | Yes | — | MCP + Skills | -| **Windsurf** | Yes | — | — | MCP | -| **OpenCode** | Yes | Yes | — | MCP + Skills | +| Editor | MCP | Skills | Hooks (auto-augment) | Support | +| --------------- | --- | ------ | -------------------- | ------------ | +| **Claude Code** | Yes | Yes | Yes (PreToolUse) | **Full** | +| **Cursor** | Yes | Yes | — | MCP + Skills | +| **Codex** | Yes | Yes | — | MCP + Skills | +| **Windsurf** | Yes | — | — | MCP | +| **OpenCode** | Yes | Yes | — | MCP + Skills | > **Claude Code** gets the deepest integration: MCP tools + agent skills + PreToolUse hooks that automatically enrich grep/glob/bash calls with knowledge graph context. ### Community Integrations -| Agent | Install | Source | -|-------|---------|--------| +| Agent | Install | Source | +| -------------------- | ---------------------------- | ------------------------------------------------------- | | [pi](https://pi.dev) | `pi install npm:pi-gitnexus` | [pi-gitnexus](https://github.com/tintinweb/pi-gitnexus) | ## MCP Setup (manual) @@ -115,36 +115,36 @@ The result is a **LadybugDB graph database** stored locally in `.gitnexus/` with Your AI agent gets these tools automatically: -| Tool | What It Does | `repo` Param | -|------|-------------|--------------| -| `list_repos` | Discover all indexed repositories | — | -| `query` | Process-grouped hybrid search (BM25 + semantic + RRF) | Optional | -| `context` | 360-degree symbol view — categorized refs, process participation | Optional | -| `impact` | Blast radius analysis with depth grouping and confidence | Optional | -| `detect_changes` | Git-diff impact — maps changed lines to affected processes | Optional | -| `rename` | Multi-file coordinated rename with graph + text search | Optional | -| `cypher` | Raw Cypher graph queries | Optional | +| Tool | What It Does | `repo` Param | +| ---------------- | ---------------------------------------------------------------- | ------------ | +| `list_repos` | Discover all indexed repositories | — | +| `query` | Process-grouped hybrid search (BM25 + semantic + RRF) | Optional | +| `context` | 360-degree symbol view — categorized refs, process participation | Optional | +| `impact` | Blast radius analysis with depth grouping and confidence | Optional | +| `detect_changes` | Git-diff impact — maps changed lines to affected processes | Optional | +| `rename` | Multi-file coordinated rename with graph + text search | Optional | +| `cypher` | Raw Cypher graph queries | Optional | > With one indexed repo, the `repo` param is optional. With multiple, specify which: `query({query: "auth", repo: "my-app"})`. ## MCP Resources -| Resource | Purpose | -|----------|---------| -| `gitnexus://repos` | List all indexed repositories (read first) | -| `gitnexus://repo/{name}/context` | Codebase stats, staleness check, and available tools | -| `gitnexus://repo/{name}/clusters` | All functional clusters with cohesion scores | -| `gitnexus://repo/{name}/cluster/{name}` | Cluster members and details | -| `gitnexus://repo/{name}/processes` | All execution flows | -| `gitnexus://repo/{name}/process/{name}` | Full process trace with steps | -| `gitnexus://repo/{name}/schema` | Graph schema for Cypher queries | +| Resource | Purpose | +| --------------------------------------- | ---------------------------------------------------- | +| `gitnexus://repos` | List all indexed repositories (read first) | +| `gitnexus://repo/{name}/context` | Codebase stats, staleness check, and available tools | +| `gitnexus://repo/{name}/clusters` | All functional clusters with cohesion scores | +| `gitnexus://repo/{name}/cluster/{name}` | Cluster members and details | +| `gitnexus://repo/{name}/processes` | All execution flows | +| `gitnexus://repo/{name}/process/{name}` | Full process trace with steps | +| `gitnexus://repo/{name}/schema` | Graph schema for Cypher queries | ## MCP Prompts -| Prompt | What It Does | -|--------|-------------| -| `detect_impact` | Pre-commit change analysis — scope, affected processes, risk level | -| `generate_map` | Architecture documentation from the knowledge graph with mermaid diagrams | +| Prompt | What It Does | +| --------------- | ------------------------------------------------------------------------- | +| `detect_impact` | Pre-commit change analysis — scope, affected processes, risk level | +| `generate_map` | Architecture documentation from the knowledge graph with mermaid diagrams | ## CLI Commands @@ -200,21 +200,21 @@ TypeScript, JavaScript, Python, Java, C, C++, C#, Go, Rust, PHP, Kotlin, Swift, ### Language Feature Matrix -| Language | Imports | Named Bindings | Exports | Heritage | Type Annotations | Constructor Inference | Config | Frameworks | Entry Points | -|----------|---------|----------------|---------|----------|-----------------|---------------------|--------|------------|-------------| -| TypeScript | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| JavaScript | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | -| Python | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Java | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | -| Kotlin | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | -| C# | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Go | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Rust | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | -| PHP | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | -| Ruby | ✓ | — | ✓ | ✓ | — | ✓ | — | ✓ | ✓ | -| Swift | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| C | — | — | ✓ | — | ✓ | ✓ | — | ✓ | ✓ | -| C++ | — | — | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | +| Language | Imports | Named Bindings | Exports | Heritage | Type Annotations | Constructor Inference | Config | Frameworks | Entry Points | +| ---------- | ------- | -------------- | ------- | -------- | ---------------- | --------------------- | ------ | ---------- | ------------ | +| TypeScript | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| JavaScript | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | +| Python | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| Java | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | +| Kotlin | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | +| C# | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| Go | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| Rust | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | +| PHP | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | +| Ruby | ✓ | — | ✓ | ✓ | — | ✓ | — | ✓ | ✓ | +| Swift | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| C | — | — | ✓ | — | ✓ | ✓ | — | ✓ | ✓ | +| C++ | — | — | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | **Imports** — cross-file import resolution · **Named Bindings** — `import { X as Y }` / re-export tracking · **Exports** — public/exported symbol detection · **Heritage** — class inheritance, interfaces, mixins · **Type Annotations** — explicit type extraction for receiver resolution · **Constructor Inference** — infer receiver type from constructor calls (`self`/`this` resolution included for all languages) · **Config** — language toolchain config parsing (tsconfig, go.mod, etc.) · **Frameworks** — AST-based framework pattern detection · **Entry Points** — entry point scoring heuristics diff --git a/gitnexus/skills/gitnexus-cli.md b/gitnexus/skills/gitnexus-cli.md index c9e0af341..6bb663d92 100644 --- a/gitnexus/skills/gitnexus-cli.md +++ b/gitnexus/skills/gitnexus-cli.md @@ -1,6 +1,6 @@ --- name: gitnexus-cli -description: "Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\"" +description: 'Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: "Index this repo", "Reanalyze the codebase", "Generate a wiki"' --- # GitNexus CLI Commands diff --git a/gitnexus/skills/gitnexus-debugging.md b/gitnexus/skills/gitnexus-debugging.md index 9510b97ac..b008df291 100644 --- a/gitnexus/skills/gitnexus-debugging.md +++ b/gitnexus/skills/gitnexus-debugging.md @@ -1,6 +1,6 @@ --- name: gitnexus-debugging -description: "Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: \"Why is X failing?\", \"Where does this error come from?\", \"Trace this bug\"" +description: 'Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: "Why is X failing?", "Where does this error come from?", "Trace this bug"' --- # Debugging with GitNexus diff --git a/gitnexus/skills/gitnexus-exploring.md b/gitnexus/skills/gitnexus-exploring.md index 927a4e4b6..99a9f34c0 100644 --- a/gitnexus/skills/gitnexus-exploring.md +++ b/gitnexus/skills/gitnexus-exploring.md @@ -1,6 +1,6 @@ --- name: gitnexus-exploring -description: "Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\"" +description: 'Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: "How does X work?", "What calls this function?", "Show me the auth flow"' --- # Exploring Codebases with GitNexus diff --git a/gitnexus/skills/gitnexus-guide.md b/gitnexus/skills/gitnexus-guide.md index 937ac73d1..8d07ba292 100644 --- a/gitnexus/skills/gitnexus-guide.md +++ b/gitnexus/skills/gitnexus-guide.md @@ -1,6 +1,6 @@ --- name: gitnexus-guide -description: "Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: \"What GitNexus tools are available?\", \"How do I use GitNexus?\"" +description: 'Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: "What GitNexus tools are available?", "How do I use GitNexus?"' --- # GitNexus Guide @@ -19,8 +19,8 @@ For any task involving code understanding, debugging, impact analysis, or refact ## Skills -| Task | Skill to read | -| -------------------------------------------- | ------------------- | +| Task | Skill to read | +| -------------------------------------------- | ---------------------------- | | Understand architecture / "How does X work?" | `gitnexus-exploring` | | Blast radius / "What breaks if I change X?" | `gitnexus-impact-analysis` | | Trace bugs / "Why is X failing?" | `gitnexus-debugging` | diff --git a/gitnexus/skills/gitnexus-impact-analysis.md b/gitnexus/skills/gitnexus-impact-analysis.md index e19af280c..f526247bd 100644 --- a/gitnexus/skills/gitnexus-impact-analysis.md +++ b/gitnexus/skills/gitnexus-impact-analysis.md @@ -1,6 +1,6 @@ --- name: gitnexus-impact-analysis -description: "Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: \"Is it safe to change X?\", \"What depends on this?\", \"What will break?\"" +description: 'Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: "Is it safe to change X?", "What depends on this?", "What will break?"' --- # Impact Analysis with GitNexus diff --git a/gitnexus/skills/gitnexus-pr-review.md b/gitnexus/skills/gitnexus-pr-review.md index e112f47ba..96efbc691 100644 --- a/gitnexus/skills/gitnexus-pr-review.md +++ b/gitnexus/skills/gitnexus-pr-review.md @@ -1,6 +1,6 @@ --- name: gitnexus-pr-review -description: "Use when the user wants to review a pull request, understand what a PR changes, assess risk of merging, or check for missing test coverage. Examples: \"Review this PR\", \"What does PR #42 change?\", \"Is this PR safe to merge?\"" +description: 'Use when the user wants to review a pull request, understand what a PR changes, assess risk of merging, or check for missing test coverage. Examples: "Review this PR", "What does PR #42 change?", "Is this PR safe to merge?"' --- # PR Review with GitNexus @@ -43,23 +43,23 @@ description: "Use when the user wants to review a pull request, understand what ## Review Dimensions -| Dimension | How GitNexus Helps | -| --- | --- | -| **Correctness** | `context` shows callers — are they all compatible with the change? | -| **Blast radius** | `impact` shows d=1/d=2/d=3 dependents — anything missed? | -| **Completeness** | `detect_changes` shows all affected flows — are they all handled? | -| **Test coverage** | `impact({includeTests: true})` shows which tests touch changed code | +| Dimension | How GitNexus Helps | +| -------------------- | --------------------------------------------------------------------- | +| **Correctness** | `context` shows callers — are they all compatible with the change? | +| **Blast radius** | `impact` shows d=1/d=2/d=3 dependents — anything missed? | +| **Completeness** | `detect_changes` shows all affected flows — are they all handled? | +| **Test coverage** | `impact({includeTests: true})` shows which tests touch changed code | | **Breaking changes** | d=1 upstream items that aren't updated in the PR = potential breakage | ## Risk Assessment -| Signal | Risk | -| --- | --- | -| Changes touch <3 symbols, 0-1 processes | LOW | -| Changes touch 3-10 symbols, 2-5 processes | MEDIUM | -| Changes touch >10 symbols or many processes | HIGH | -| Changes touch auth, payments, or data integrity code | CRITICAL | -| d=1 callers exist outside the PR diff | Potential breakage — flag it | +| Signal | Risk | +| ---------------------------------------------------- | ---------------------------- | +| Changes touch <3 symbols, 0-1 processes | LOW | +| Changes touch 3-10 symbols, 2-5 processes | MEDIUM | +| Changes touch >10 symbols or many processes | HIGH | +| Changes touch auth, payments, or data integrity code | CRITICAL | +| d=1 callers exist outside the PR diff | Potential breakage — flag it | ## Tools @@ -146,18 +146,22 @@ Structure your review as: **Risk: LOW / MEDIUM / HIGH / CRITICAL** ### Changes Summary + - symbols changed across files -

execution flows affected ### Findings + 1. **[severity]** Description of finding - Evidence from GitNexus tools - Affected callers/flows ### Missing Coverage + - Callers not updated in PR: ... - Untested flows: ... ### Recommendation + APPROVE / REQUEST CHANGES / NEEDS DISCUSSION ``` diff --git a/gitnexus/skills/gitnexus-refactoring.md b/gitnexus/skills/gitnexus-refactoring.md index f48cc01bd..d16b5658a 100644 --- a/gitnexus/skills/gitnexus-refactoring.md +++ b/gitnexus/skills/gitnexus-refactoring.md @@ -1,6 +1,6 @@ --- name: gitnexus-refactoring -description: "Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: \"Rename this function\", \"Extract this into a module\", \"Refactor this class\", \"Move this to a separate file\"" +description: 'Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: "Rename this function", "Extract this into a module", "Refactor this class", "Move this to a separate file"' --- # Refactoring with GitNexus diff --git a/gitnexus/src/core/ingestion/workers/parse-worker.ts b/gitnexus/src/core/ingestion/workers/parse-worker.ts index 096aed76c..7500c2dae 100644 --- a/gitnexus/src/core/ingestion/workers/parse-worker.ts +++ b/gitnexus/src/core/ingestion/workers/parse-worker.ts @@ -1361,12 +1361,20 @@ export function extractWebhooks(filePath: string, content: string, out: Extracte const lowerPath = filePath.toLowerCase(); // Skip test files — they often mock webhook patterns (e.g. Stripe constructEvent in test mocks) - if (lowerPath.includes('/test') || lowerPath.includes('.test.') || lowerPath.includes('.spec.') || lowerPath.includes('__test')) return; + if ( + lowerPath.includes('/test') || + lowerPath.includes('.test.') || + lowerPath.includes('.spec.') || + lowerPath.includes('__test') + ) + return; // Count newlines before offset without allocating substring + split array const lineAt = (offset: number): number => { let n = 0; - for (let i = 0; i < offset; i++) { if (content.charCodeAt(i) === 10) n++; } + for (let i = 0; i < offset; i++) { + if (content.charCodeAt(i) === 10) n++; + } return n; }; @@ -1374,33 +1382,58 @@ export function extractWebhooks(filePath: string, content: string, out: Extracte const eventTypes: string[] = []; const caseRe = /case\s+['"]([.\w-]+)['"]/g; let m; - while ((m = caseRe.exec(content)) !== null) { eventTypes.push(m[1]); } + while ((m = caseRe.exec(content)) !== null) { + eventTypes.push(m[1]); + } const idx = content.indexOf('constructEvent'); - out.push({ filePath, name: 'stripe-webhook', kind: 'stripe', eventTypes, - lineNumber: idx > -1 ? lineAt(idx) : 0 }); + out.push({ + filePath, + name: 'stripe-webhook', + kind: 'stripe', + eventTypes, + lineNumber: idx > -1 ? lineAt(idx) : 0, + }); return; } const edgeFnMatch = filePath.match(/supabase\/functions\/([\w-]+)\/index\.ts$/); if (edgeFnMatch && content.includes('Deno.serve')) { - out.push({ filePath, name: edgeFnMatch[1], kind: 'edge-function', eventTypes: [], - lineNumber: lineAt(content.indexOf('Deno.serve')) }); + out.push({ + filePath, + name: edgeFnMatch[1], + kind: 'edge-function', + eventTypes: [], + lineNumber: lineAt(content.indexOf('Deno.serve')), + }); return; } if (content.includes('postgres_changes')) { const channelRe = /\.channel\s*\(\s*['"`]([^'"`]+)['"`]\s*\)/g; let m; while ((m = channelRe.exec(content)) !== null) { - out.push({ filePath, name: `realtime:${m[1]}`, kind: 'realtime', eventTypes: [], - lineNumber: lineAt(m.index) }); + out.push({ + filePath, + name: `realtime:${m[1]}`, + kind: 'realtime', + eventTypes: [], + lineNumber: lineAt(m.index), + }); } } if (lowerPath.includes('webhook') || lowerPath.includes('hook')) { - const hasSigVerify = content.includes('x-webhook-signature') || content.includes('x-hub-signature') - || content.includes('verify'); + const hasSigVerify = + content.includes('x-webhook-signature') || + content.includes('x-hub-signature') || + content.includes('verify'); if (hasSigVerify) { const pathParts = filePath.split('/'); const name = pathParts[pathParts.length - 1].replace(/\.(ts|js|tsx|jsx)$/, ''); - out.push({ filePath, name: `webhook:${name}`, kind: 'generic', eventTypes: [], lineNumber: 0 }); + out.push({ + filePath, + name: `webhook:${name}`, + kind: 'generic', + eventTypes: [], + lineNumber: 0, + }); } } } @@ -1409,13 +1442,25 @@ export function extractWebhooks(filePath: string, content: string, out: Extracte * Extract message-queue producer/consumer patterns from source code. * Detects: BullMQ, RabbitMQ (amqplib), Kafka (kafkajs), AWS SQS, Celery. */ -export function extractQueuePatterns(filePath: string, content: string, out: ExtractedQueuePattern[]): void { +export function extractQueuePatterns( + filePath: string, + content: string, + out: ExtractedQueuePattern[], +): void { const lowerPath = filePath.toLowerCase(); - if (lowerPath.includes('/test') || lowerPath.includes('.test.') || lowerPath.includes('.spec.') || lowerPath.includes('__test')) return; + if ( + lowerPath.includes('/test') || + lowerPath.includes('.test.') || + lowerPath.includes('.spec.') || + lowerPath.includes('__test') + ) + return; const lineAt = (offset: number): number => { let n = 0; - for (let i = 0; i < offset; i++) { if (content.charCodeAt(i) === 10) n++; } + for (let i = 0; i < offset; i++) { + if (content.charCodeAt(i) === 10) n++; + } return n; }; @@ -1423,59 +1468,132 @@ export function extractQueuePatterns(filePath: string, content: string, out: Ext const bullQueueRe = /new\s+Queue\s*\(\s*['"`]([^'"`]+)['"`]/g; let m; while ((m = bullQueueRe.exec(content)) !== null) { - out.push({ filePath, role: 'producer', queueName: m[1], method: 'Queue', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'producer', + queueName: m[1], + method: 'Queue', + lineNumber: lineAt(m.index), + }); } const bullWorkerRe = /new\s+Worker\s*\(\s*['"`]([^'"`]+)['"`]/g; while ((m = bullWorkerRe.exec(content)) !== null) { - out.push({ filePath, role: 'consumer', queueName: m[1], method: 'Worker', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'consumer', + queueName: m[1], + method: 'Worker', + lineNumber: lineAt(m.index), + }); } const bullProcessRe = /\.process\s*\(\s*['"`]([^'"`]+)['"`]/g; while ((m = bullProcessRe.exec(content)) !== null) { - out.push({ filePath, role: 'consumer', queueName: m[1], method: 'process', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'consumer', + queueName: m[1], + method: 'process', + lineNumber: lineAt(m.index), + }); } // RabbitMQ (amqplib) — sendToQueue / publish = producer, consume / assertQueue + consume = consumer const amqpSendRe = /\.sendToQueue\s*\(\s*['"`]([^'"`]+)['"`]/g; while ((m = amqpSendRe.exec(content)) !== null) { - out.push({ filePath, role: 'producer', queueName: m[1], method: 'sendToQueue', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'producer', + queueName: m[1], + method: 'sendToQueue', + lineNumber: lineAt(m.index), + }); } const amqpPublishRe = /\.publish\s*\(\s*['"`]([^'"`]+)['"`]\s*,\s*['"`]([^'"`]+)['"`]/g; while ((m = amqpPublishRe.exec(content)) !== null) { - out.push({ filePath, role: 'producer', queueName: `${m[1]}/${m[2]}`, method: 'publish', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'producer', + queueName: `${m[1]}/${m[2]}`, + method: 'publish', + lineNumber: lineAt(m.index), + }); } const amqpConsumeRe = /\.consume\s*\(\s*['"`]([^'"`]+)['"`]/g; while ((m = amqpConsumeRe.exec(content)) !== null) { - out.push({ filePath, role: 'consumer', queueName: m[1], method: 'consume', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'consumer', + queueName: m[1], + method: 'consume', + lineNumber: lineAt(m.index), + }); } // Kafka (kafkajs) — producer.send({topic: '...'}) = producer, consumer.subscribe({topic: '...'}) = consumer const kafkaSendRe = /\.send\s*\(\s*\{[^}]*topic\s*:\s*['"`]([^'"`]+)['"`]/g; while ((m = kafkaSendRe.exec(content)) !== null) { - out.push({ filePath, role: 'producer', queueName: m[1], method: 'send', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'producer', + queueName: m[1], + method: 'send', + lineNumber: lineAt(m.index), + }); } const kafkaSubRe = /\.subscribe\s*\(\s*\{[^}]*topic\s*:\s*['"`]([^'"`]+)['"`]/g; while ((m = kafkaSubRe.exec(content)) !== null) { - out.push({ filePath, role: 'consumer', queueName: m[1], method: 'subscribe', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'consumer', + queueName: m[1], + method: 'subscribe', + lineNumber: lineAt(m.index), + }); } // AWS SQS — sendMessage/sendMessageBatch with QueueUrl = producer, receiveMessage = consumer const sqsSendRe = /sendMessage(?:Batch)?\s*\(\s*\{[^}]*QueueUrl\s*:\s*['"`]([^'"`]+)['"`]/g; while ((m = sqsSendRe.exec(content)) !== null) { - out.push({ filePath, role: 'producer', queueName: m[1], method: 'sendMessage', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'producer', + queueName: m[1], + method: 'sendMessage', + lineNumber: lineAt(m.index), + }); } const sqsRecvRe = /receiveMessage\s*\(\s*\{[^}]*QueueUrl\s*:\s*['"`]([^'"`]+)['"`]/g; while ((m = sqsRecvRe.exec(content)) !== null) { - out.push({ filePath, role: 'consumer', queueName: m[1], method: 'receiveMessage', lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'consumer', + queueName: m[1], + method: 'receiveMessage', + lineNumber: lineAt(m.index), + }); } // Celery (Python) — @app.task / .delay() / .apply_async() const celeryTaskRe = /@(?:app|celery)\.task[^]*?def\s+(\w+)/g; while ((m = celeryTaskRe.exec(content)) !== null) { - out.push({ filePath, role: 'consumer', queueName: m[1], method: 'task', handlerName: m[1], lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'consumer', + queueName: m[1], + method: 'task', + handlerName: m[1], + lineNumber: lineAt(m.index), + }); } const celeryCallRe = /(\w+)\.(delay|apply_async)\s*\(/g; while ((m = celeryCallRe.exec(content)) !== null) { - out.push({ filePath, role: 'producer', queueName: m[1], method: m[2], lineNumber: lineAt(m.index) }); + out.push({ + filePath, + role: 'producer', + queueName: m[1], + method: m[2], + lineNumber: lineAt(m.index), + }); } } diff --git a/gitnexus/src/core/lbug/csv-generator.ts b/gitnexus/src/core/lbug/csv-generator.ts index 209432a3c..867eeb5fd 100644 --- a/gitnexus/src/core/lbug/csv-generator.ts +++ b/gitnexus/src/core/lbug/csv-generator.ts @@ -452,14 +452,14 @@ export const streamAllCSVsToDisk = async ( ); break; case 'Webhook': { - const eventTypes = node.properties.eventTypes as string[] || []; + const eventTypes = (node.properties.eventTypes as string[]) || []; const eventTypesStr = `[${eventTypes.map((e: string) => `'${e.replace(/'/g, "''")}'`).join(',')}]`; await webhookWriter.addRow( [ escapeCSVField(node.id), escapeCSVField(node.properties.name || ''), escapeCSVField(node.properties.filePath || ''), - escapeCSVField(node.properties.kind as string || ''), + escapeCSVField((node.properties.kind as string) || ''), escapeCSVField(eventTypesStr), ].join(','), ); diff --git a/gitnexus/src/mcp/local/local-backend.ts b/gitnexus/src/mcp/local/local-backend.ts index 90f5f54b2..79e3f6b97 100644 --- a/gitnexus/src/mcp/local/local-backend.ts +++ b/gitnexus/src/mcp/local/local-backend.ts @@ -3221,27 +3221,44 @@ export class LocalBackend { }; } - private async webhookMap(repo: RepoHandle, params: { kind?: string; name?: string }): Promise { + private async webhookMap( + repo: RepoHandle, + params: { kind?: string; name?: string }, + ): Promise { await this.ensureInitialized(repo.id); const kindFilter = params.kind ? `AND n.kind = $kind` : ''; const nameFilter = params.name ? `AND n.name CONTAINS $name` : ''; const queryParams: Record = {}; if (params.kind) queryParams.kind = params.kind; if (params.name) queryParams.name = params.name; - const rows = await executeParameterized(repo.id, ` + const rows = await executeParameterized( + repo.id, + ` MATCH (n:Webhook) WHERE n.id STARTS WITH 'Webhook:' ${kindFilter} ${nameFilter} RETURN n.id AS id, n.name AS name, n.filePath AS filePath, n.kind AS kind, n.eventTypes AS eventTypes - `, queryParams); - const triggerRows = await executeParameterized(repo.id, ` + `, + queryParams, + ); + const triggerRows = await executeParameterized( + repo.id, + ` MATCH (f:File)-[r:CodeRelation {type: 'TRIGGERS'}]->(w:Webhook) RETURN f.filePath AS source, w.name AS target, r.reason AS reason - `, {}); + `, + {}, + ); const webhooks = rows.map((r: any) => ({ - id: r.id, name: r.name, filePath: r.filePath, kind: r.kind, eventTypes: r.eventTypes || [], + id: r.id, + name: r.name, + filePath: r.filePath, + kind: r.kind, + eventTypes: r.eventTypes || [], })); const triggers = triggerRows.map((r: any) => ({ - source: r.source, target: r.target, reason: r.reason, + source: r.source, + target: r.target, + reason: r.reason, })); return { webhooks, triggers, total: webhooks.length }; } diff --git a/gitnexus/test/fixtures/cross-file-binding/js-cross-file/src/models.js b/gitnexus/test/fixtures/cross-file-binding/js-cross-file/src/models.js index 5d33e9be4..3b519030d 100644 --- a/gitnexus/test/fixtures/cross-file-binding/js-cross-file/src/models.js +++ b/gitnexus/test/fixtures/cross-file-binding/js-cross-file/src/models.js @@ -1,6 +1,8 @@ export class User { save() {} - getName() { return ''; } + getName() { + return ''; + } } export function getUser() { diff --git a/gitnexus/test/fixtures/cross-file-binding/ts-reexport/src/core.ts b/gitnexus/test/fixtures/cross-file-binding/ts-reexport/src/core.ts index 93000e716..8442959ea 100644 --- a/gitnexus/test/fixtures/cross-file-binding/ts-reexport/src/core.ts +++ b/gitnexus/test/fixtures/cross-file-binding/ts-reexport/src/core.ts @@ -1,5 +1,7 @@ export class Config { - validate(): boolean { return true; } + validate(): boolean { + return true; + } } export function getConfig(): Config { return new Config(); diff --git a/gitnexus/test/fixtures/cross-file-binding/ts-return-type/src/api.ts b/gitnexus/test/fixtures/cross-file-binding/ts-return-type/src/api.ts index 93000e716..8442959ea 100644 --- a/gitnexus/test/fixtures/cross-file-binding/ts-return-type/src/api.ts +++ b/gitnexus/test/fixtures/cross-file-binding/ts-return-type/src/api.ts @@ -1,5 +1,7 @@ export class Config { - validate(): boolean { return true; } + validate(): boolean { + return true; + } } export function getConfig(): Config { return new Config(); diff --git a/gitnexus/test/fixtures/cross-file-binding/ts-simple/src/models.ts b/gitnexus/test/fixtures/cross-file-binding/ts-simple/src/models.ts index b2115f9f2..3f0deb131 100644 --- a/gitnexus/test/fixtures/cross-file-binding/ts-simple/src/models.ts +++ b/gitnexus/test/fixtures/cross-file-binding/ts-simple/src/models.ts @@ -1,6 +1,8 @@ export class User { save(): void {} - getName(): string { return ''; } + getName(): string { + return ''; + } } export function getUser(): User { return new User(); diff --git a/gitnexus/test/fixtures/expo-app/app/(auth)/_layout.tsx b/gitnexus/test/fixtures/expo-app/app/(auth)/_layout.tsx index e3aef70f8..e80ce4eac 100644 --- a/gitnexus/test/fixtures/expo-app/app/(auth)/_layout.tsx +++ b/gitnexus/test/fixtures/expo-app/app/(auth)/_layout.tsx @@ -1,2 +1,4 @@ import { Slot } from 'expo-router'; -export default function AuthLayout() { return ; } +export default function AuthLayout() { + return ; +} diff --git a/gitnexus/test/fixtures/expo-app/app/(auth)/login.tsx b/gitnexus/test/fixtures/expo-app/app/(auth)/login.tsx index 95ebd11ae..2c41ba2c8 100644 --- a/gitnexus/test/fixtures/expo-app/app/(auth)/login.tsx +++ b/gitnexus/test/fixtures/expo-app/app/(auth)/login.tsx @@ -1,2 +1,6 @@ import { useRouter } from 'expo-router'; -export default function Login() { const router = useRouter(); router.push('/'); return null; } +export default function Login() { + const router = useRouter(); + router.push('/'); + return null; +} diff --git a/gitnexus/test/fixtures/expo-app/app/_layout.tsx b/gitnexus/test/fixtures/expo-app/app/_layout.tsx index 8ccd9b10b..bb75780f7 100644 --- a/gitnexus/test/fixtures/expo-app/app/_layout.tsx +++ b/gitnexus/test/fixtures/expo-app/app/_layout.tsx @@ -1,2 +1,4 @@ import { Slot } from 'expo-router'; -export default function Layout() { return ; } +export default function Layout() { + return ; +} diff --git a/gitnexus/test/fixtures/expo-app/app/index.tsx b/gitnexus/test/fixtures/expo-app/app/index.tsx index 9812c1569..403235284 100644 --- a/gitnexus/test/fixtures/expo-app/app/index.tsx +++ b/gitnexus/test/fixtures/expo-app/app/index.tsx @@ -1 +1,3 @@ -export default function Home() { return null; } +export default function Home() { + return null; +} diff --git a/gitnexus/test/fixtures/expo-app/app/profile.tsx b/gitnexus/test/fixtures/expo-app/app/profile.tsx index e8e67920e..c1ed01e40 100644 --- a/gitnexus/test/fixtures/expo-app/app/profile.tsx +++ b/gitnexus/test/fixtures/expo-app/app/profile.tsx @@ -1 +1,3 @@ -export default function Profile() { return null; } +export default function Profile() { + return null; +} diff --git a/gitnexus/test/fixtures/expo-app/app/settings.tsx b/gitnexus/test/fixtures/expo-app/app/settings.tsx index 02d45dfc3..e3d3065d3 100644 --- a/gitnexus/test/fixtures/expo-app/app/settings.tsx +++ b/gitnexus/test/fixtures/expo-app/app/settings.tsx @@ -1,2 +1,4 @@ import { Link } from 'expo-router'; -export default function Settings() { return Go; } +export default function Settings() { + return Go; +} diff --git a/gitnexus/test/fixtures/expo-app/app/user/[id].tsx b/gitnexus/test/fixtures/expo-app/app/user/[id].tsx index f3f8a0e41..a16a396f2 100644 --- a/gitnexus/test/fixtures/expo-app/app/user/[id].tsx +++ b/gitnexus/test/fixtures/expo-app/app/user/[id].tsx @@ -1,2 +1,5 @@ import { useLocalSearchParams } from 'expo-router'; -export default function UserDetail() { const { id } = useLocalSearchParams(); return null; } +export default function UserDetail() { + const { id } = useLocalSearchParams(); + return null; +} diff --git a/gitnexus/test/fixtures/expo-app/package.json b/gitnexus/test/fixtures/expo-app/package.json index eb9ac32e5..0989fc608 100644 --- a/gitnexus/test/fixtures/expo-app/package.json +++ b/gitnexus/test/fixtures/expo-app/package.json @@ -1 +1,6 @@ -{"name": "expo-app-fixture", "dependencies": {"expo-router": "^3.0.0"}} +{ + "name": "expo-app-fixture", + "dependencies": { + "expo-router": "^3.0.0" + } +} diff --git a/gitnexus/test/fixtures/group/group.yaml b/gitnexus/test/fixtures/group/group.yaml index 3a7fa5a31..834485caa 100644 --- a/gitnexus/test/fixtures/group/group.yaml +++ b/gitnexus/test/fixtures/group/group.yaml @@ -1,7 +1,7 @@ # Test group for integration / fixture-driven tests version: 1 name: test-group -description: "Test group for integration tests" +description: 'Test group for integration tests' repos: app/backend: test-backend diff --git a/gitnexus/test/fixtures/group/test-monorepo/services/auth/package.json b/gitnexus/test/fixtures/group/test-monorepo/services/auth/package.json index 21f7d53e2..04041c7ca 100644 --- a/gitnexus/test/fixtures/group/test-monorepo/services/auth/package.json +++ b/gitnexus/test/fixtures/group/test-monorepo/services/auth/package.json @@ -1 +1,4 @@ -{ "name": "@monorepo/auth", "version": "1.0.0" } +{ + "name": "@monorepo/auth", + "version": "1.0.0" +} diff --git a/gitnexus/test/fixtures/group/test-monorepo/services/gateway/package.json b/gitnexus/test/fixtures/group/test-monorepo/services/gateway/package.json index 14e0f8797..c5d4a8a75 100644 --- a/gitnexus/test/fixtures/group/test-monorepo/services/gateway/package.json +++ b/gitnexus/test/fixtures/group/test-monorepo/services/gateway/package.json @@ -1 +1,4 @@ -{ "name": "@monorepo/gateway", "version": "1.0.0" } +{ + "name": "@monorepo/gateway", + "version": "1.0.0" +} diff --git a/gitnexus/test/fixtures/group/test-monorepo/services/orders/package.json b/gitnexus/test/fixtures/group/test-monorepo/services/orders/package.json index ab03bf430..0e27e09c8 100644 --- a/gitnexus/test/fixtures/group/test-monorepo/services/orders/package.json +++ b/gitnexus/test/fixtures/group/test-monorepo/services/orders/package.json @@ -1 +1,4 @@ -{ "name": "@monorepo/orders", "version": "1.0.0" } +{ + "name": "@monorepo/orders", + "version": "1.0.0" +} diff --git a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/app/api/grants/route.ts b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/app/api/grants/route.ts index 8fe1bfcf2..2bfdabb54 100644 --- a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/app/api/grants/route.ts +++ b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/app/api/grants/route.ts @@ -6,6 +6,9 @@ export async function GET() { const grants = await fetchGrants(); return NextResponse.json({ data: grants, pagination: { page: 1, total: grants.length } }); } catch (err) { - return NextResponse.json({ error: 'Failed to fetch grants', message: String(err) }, { status: 400 }); + return NextResponse.json( + { error: 'Failed to fetch grants', message: String(err) }, + { status: 400 }, + ); } } diff --git a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/app/api/secure/route.ts b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/app/api/secure/route.ts index 6e8d1b615..d0b6d6016 100644 --- a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/app/api/secure/route.ts +++ b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/app/api/secure/route.ts @@ -2,9 +2,11 @@ import { NextResponse } from 'next/server'; import { withAuth } from '../../../middleware/auth'; import { withRateLimit } from '../../../middleware/rate-limit'; -export const GET = withAuth(withRateLimit(async (req: Request) => { - return NextResponse.json({ items: [], count: 0 }); -})); +export const GET = withAuth( + withRateLimit(async (req: Request) => { + return NextResponse.json({ items: [], count: 0 }); + }), +); export const POST = async (req: Request) => { const body = await req.json(); diff --git a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/components/GrantsList.tsx b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/components/GrantsList.tsx index 78707466d..ccab9b78e 100644 --- a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/components/GrantsList.tsx +++ b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/components/GrantsList.tsx @@ -3,7 +3,9 @@ export async function GrantsList() { const { data, pagination } = await res.json(); return (

    - {data.map((g: any) =>
  • {g.title}
  • )} + {data.map((g: any) => ( +
  • {g.title}
  • + ))}

    Page {pagination.page}

); diff --git a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/hooks/useMulti.ts b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/hooks/useMulti.ts index 618372363..4b64e648a 100644 --- a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/hooks/useMulti.ts +++ b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/hooks/useMulti.ts @@ -1,8 +1,5 @@ export async function useMulti() { - const [grantsRes, secureRes] = await Promise.all([ - fetch('/api/grants'), - fetch('/api/secure'), - ]); + const [grantsRes, secureRes] = await Promise.all([fetch('/api/grants'), fetch('/api/secure')]); const grants = await grantsRes.json(); const secure = await secureRes.json(); return { grants: grants.data, secure: secure.items, meta: grants.meta }; diff --git a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/lib/errors.ts b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/lib/errors.ts index ac4e1f843..8988470e6 100644 --- a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/lib/errors.ts +++ b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/lib/errors.ts @@ -1,5 +1,8 @@ export class ApiError extends Error { - constructor(public statusCode: number, message: string) { + constructor( + public statusCode: number, + message: string, + ) { super(message); } } diff --git a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/lib/grants.ts b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/lib/grants.ts index 37a1ca8a5..48cb41173 100644 --- a/gitnexus/test/fixtures/lang-resolution/api-e2e-test/lib/grants.ts +++ b/gitnexus/test/fixtures/lang-resolution/api-e2e-test/lib/grants.ts @@ -1,3 +1,6 @@ export async function fetchGrants() { - return [{ id: 1, title: 'Grant A' }, { id: 2, title: 'Grant B' }]; + return [ + { id: 1, title: 'Grant A' }, + { id: 2, title: 'Grant B' }, + ]; } diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper1.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper1.ts index 641a1241e..12d97174b 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper1.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper1.ts @@ -1 +1,3 @@ -export function helper1() { return 1; } +export function helper1() { + return 1; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper10.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper10.ts index 573fbc850..2de0890b8 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper10.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper10.ts @@ -1 +1,3 @@ -export function helper10() { return 10; } +export function helper10() { + return 10; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper11.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper11.ts index 42a7f5375..792d2e66f 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper11.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper11.ts @@ -1 +1,3 @@ -export function helper11() { return 11; } +export function helper11() { + return 11; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper12.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper12.ts index 4c6444e79..13edc6734 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper12.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper12.ts @@ -1 +1,3 @@ -export function helper12() { return 12; } +export function helper12() { + return 12; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper13.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper13.ts index ce7d1485c..21a11fbbf 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper13.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper13.ts @@ -1 +1,3 @@ -export function helper13() { return 13; } +export function helper13() { + return 13; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper2.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper2.ts index 85256d5da..aa6d4aa3b 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper2.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper2.ts @@ -1 +1,3 @@ -export function helper2() { return 2; } +export function helper2() { + return 2; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper3.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper3.ts index 32cc94bc2..4ea1d2027 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper3.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper3.ts @@ -1 +1,3 @@ -export function helper3() { return 3; } +export function helper3() { + return 3; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper4.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper4.ts index bcc4280e7..29631a685 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper4.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper4.ts @@ -1 +1,3 @@ -export function helper4() { return 4; } +export function helper4() { + return 4; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper5.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper5.ts index 315fa4886..f96f89c89 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper5.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper5.ts @@ -1 +1,3 @@ -export function helper5() { return 5; } +export function helper5() { + return 5; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper6.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper6.ts index 4ea12d963..4f48fa2e4 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper6.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper6.ts @@ -1 +1,3 @@ -export function helper6() { return 6; } +export function helper6() { + return 6; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper7.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper7.ts index 429b7451f..1ebdb5578 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper7.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper7.ts @@ -1 +1,3 @@ -export function helper7() { return 7; } +export function helper7() { + return 7; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper8.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper8.ts index c90a6e917..c9382f36a 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper8.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper8.ts @@ -1 +1,3 @@ -export function helper8() { return 8; } +export function helper8() { + return 8; +} diff --git a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper9.ts b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper9.ts index 07136610e..04ad6da40 100644 --- a/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper9.ts +++ b/gitnexus/test/fixtures/lang-resolution/express-route-mapping/helper9.ts @@ -1 +1,3 @@ -export function helper9() { return 9; } +export function helper9() { + return 9; +} diff --git a/gitnexus/test/fixtures/lang-resolution/javascript-method-enrichment/animal.js b/gitnexus/test/fixtures/lang-resolution/javascript-method-enrichment/animal.js index fba596b4a..1b08fdaf1 100644 --- a/gitnexus/test/fixtures/lang-resolution/javascript-method-enrichment/animal.js +++ b/gitnexus/test/fixtures/lang-resolution/javascript-method-enrichment/animal.js @@ -1,21 +1,21 @@ class Animal { - speak() { - throw new Error("Not implemented"); - } + speak() { + throw new Error('Not implemented'); + } - static classify(name) { - return "mammal"; - } + static classify(name) { + return 'mammal'; + } - breathe() { - return true; - } + breathe() { + return true; + } } class Dog extends Animal { - speak() { - return "woof"; - } + speak() { + return 'woof'; + } } module.exports = { Animal, Dog }; diff --git a/gitnexus/test/fixtures/lang-resolution/javascript-method-enrichment/app.js b/gitnexus/test/fixtures/lang-resolution/javascript-method-enrichment/app.js index dbbae4ebd..d5c33100f 100644 --- a/gitnexus/test/fixtures/lang-resolution/javascript-method-enrichment/app.js +++ b/gitnexus/test/fixtures/lang-resolution/javascript-method-enrichment/app.js @@ -2,4 +2,4 @@ const { Animal, Dog } = require('./animal'); const dog = new Dog(); const sound = dog.speak(); -const category = Animal.classify("dog"); +const category = Animal.classify('dog'); diff --git a/gitnexus/test/fixtures/lang-resolution/javascript-parent-resolution/src/models/Base.js b/gitnexus/test/fixtures/lang-resolution/javascript-parent-resolution/src/models/Base.js index 6a7bf92de..25d701d24 100644 --- a/gitnexus/test/fixtures/lang-resolution/javascript-parent-resolution/src/models/Base.js +++ b/gitnexus/test/fixtures/lang-resolution/javascript-parent-resolution/src/models/Base.js @@ -1,4 +1,6 @@ class BaseModel { - save() { return true; } + save() { + return true; + } } module.exports = { BaseModel }; diff --git a/gitnexus/test/fixtures/lang-resolution/javascript-parent-resolution/src/models/User.js b/gitnexus/test/fixtures/lang-resolution/javascript-parent-resolution/src/models/User.js index cb2644d5f..98622b36f 100644 --- a/gitnexus/test/fixtures/lang-resolution/javascript-parent-resolution/src/models/User.js +++ b/gitnexus/test/fixtures/lang-resolution/javascript-parent-resolution/src/models/User.js @@ -1,6 +1,8 @@ const { BaseModel } = require('./Base'); class User extends BaseModel { - serialize() { return ''; } + serialize() { + return ''; + } } module.exports = { User }; diff --git a/gitnexus/test/fixtures/lang-resolution/javascript-self-this-resolution/src/models/Repo.js b/gitnexus/test/fixtures/lang-resolution/javascript-self-this-resolution/src/models/Repo.js index 41ab63ddd..568752b6f 100644 --- a/gitnexus/test/fixtures/lang-resolution/javascript-self-this-resolution/src/models/Repo.js +++ b/gitnexus/test/fixtures/lang-resolution/javascript-self-this-resolution/src/models/Repo.js @@ -1,4 +1,6 @@ class Repo { - save() { return true; } + save() { + return true; + } } module.exports = { Repo }; diff --git a/gitnexus/test/fixtures/lang-resolution/javascript-self-this-resolution/src/models/User.js b/gitnexus/test/fixtures/lang-resolution/javascript-self-this-resolution/src/models/User.js index 48f4944d6..8f45b1167 100644 --- a/gitnexus/test/fixtures/lang-resolution/javascript-self-this-resolution/src/models/User.js +++ b/gitnexus/test/fixtures/lang-resolution/javascript-self-this-resolution/src/models/User.js @@ -1,5 +1,7 @@ class User { - save() { return true; } + save() { + return true; + } process() { this.save(); } diff --git a/gitnexus/test/fixtures/lang-resolution/javascript-super-resolution/src/models/Base.js b/gitnexus/test/fixtures/lang-resolution/javascript-super-resolution/src/models/Base.js index 6a7bf92de..25d701d24 100644 --- a/gitnexus/test/fixtures/lang-resolution/javascript-super-resolution/src/models/Base.js +++ b/gitnexus/test/fixtures/lang-resolution/javascript-super-resolution/src/models/Base.js @@ -1,4 +1,6 @@ class BaseModel { - save() { return true; } + save() { + return true; + } } module.exports = { BaseModel }; diff --git a/gitnexus/test/fixtures/lang-resolution/javascript-super-resolution/src/models/Repo.js b/gitnexus/test/fixtures/lang-resolution/javascript-super-resolution/src/models/Repo.js index 41ab63ddd..568752b6f 100644 --- a/gitnexus/test/fixtures/lang-resolution/javascript-super-resolution/src/models/Repo.js +++ b/gitnexus/test/fixtures/lang-resolution/javascript-super-resolution/src/models/Repo.js @@ -1,4 +1,6 @@ class Repo { - save() { return true; } + save() { + return true; + } } module.exports = { Repo }; diff --git a/gitnexus/test/fixtures/lang-resolution/js-fixpoint-for-loop/models.js b/gitnexus/test/fixtures/lang-resolution/js-fixpoint-for-loop/models.js index 28cbfb5e8..207f593c2 100644 --- a/gitnexus/test/fixtures/lang-resolution/js-fixpoint-for-loop/models.js +++ b/gitnexus/test/fixtures/lang-resolution/js-fixpoint-for-loop/models.js @@ -8,6 +8,8 @@ class User { /** * @returns {User[]} */ -function getUsers() { return []; } +function getUsers() { + return []; +} module.exports = { User, getUsers }; diff --git a/gitnexus/test/fixtures/lang-resolution/js-nullable-receiver/src/repo.js b/gitnexus/test/fixtures/lang-resolution/js-nullable-receiver/src/repo.js index 41ab63ddd..568752b6f 100644 --- a/gitnexus/test/fixtures/lang-resolution/js-nullable-receiver/src/repo.js +++ b/gitnexus/test/fixtures/lang-resolution/js-nullable-receiver/src/repo.js @@ -1,4 +1,6 @@ class Repo { - save() { return true; } + save() { + return true; + } } module.exports = { Repo }; diff --git a/gitnexus/test/fixtures/lang-resolution/js-nullable-receiver/src/user.js b/gitnexus/test/fixtures/lang-resolution/js-nullable-receiver/src/user.js index e11c8bc1a..9732ae8ff 100644 --- a/gitnexus/test/fixtures/lang-resolution/js-nullable-receiver/src/user.js +++ b/gitnexus/test/fixtures/lang-resolution/js-nullable-receiver/src/user.js @@ -1,4 +1,6 @@ class User { - save() { return true; } + save() { + return true; + } } module.exports = { User }; diff --git a/gitnexus/test/fixtures/lang-resolution/js-object-destructuring/models.js b/gitnexus/test/fixtures/lang-resolution/js-object-destructuring/models.js index 31cb47c9a..bd7f4308a 100644 --- a/gitnexus/test/fixtures/lang-resolution/js-object-destructuring/models.js +++ b/gitnexus/test/fixtures/lang-resolution/js-object-destructuring/models.js @@ -3,7 +3,9 @@ */ class Address { /** @returns {boolean} */ - save() { return true; } + save() { + return true; + } } /** diff --git a/gitnexus/test/fixtures/lang-resolution/js-object-destructuring/service.js b/gitnexus/test/fixtures/lang-resolution/js-object-destructuring/service.js index e8fc4565b..6fbcabb03 100644 --- a/gitnexus/test/fixtures/lang-resolution/js-object-destructuring/service.js +++ b/gitnexus/test/fixtures/lang-resolution/js-object-destructuring/service.js @@ -3,6 +3,8 @@ const { User } = require('./models'); /** * @returns {User} */ -function getUser() { return new User(); } +function getUser() { + return new User(); +} module.exports = { getUser }; diff --git a/gitnexus/test/fixtures/lang-resolution/js-write-access/models.js b/gitnexus/test/fixtures/lang-resolution/js-write-access/models.js index ac80db7e1..60543e959 100644 --- a/gitnexus/test/fixtures/lang-resolution/js-write-access/models.js +++ b/gitnexus/test/fixtures/lang-resolution/js-write-access/models.js @@ -1,10 +1,10 @@ class Address { - city = ''; + city = ''; } class User { - name = ''; - address = null; + name = ''; + address = null; } module.exports = { Address, User }; diff --git a/gitnexus/test/fixtures/lang-resolution/js-write-access/service.js b/gitnexus/test/fixtures/lang-resolution/js-write-access/service.js index f3e681179..e3402fa49 100644 --- a/gitnexus/test/fixtures/lang-resolution/js-write-access/service.js +++ b/gitnexus/test/fixtures/lang-resolution/js-write-access/service.js @@ -1,7 +1,7 @@ const { User, Address } = require('./models'); function updateUser() { - const user = new User(); - user.name = "Alice"; - user.address = new Address(); + const user = new User(); + user.name = 'Alice'; + user.address = new Address(); } diff --git a/gitnexus/test/fixtures/lang-resolution/nextjs-route-mapping/components/GrantsList.tsx b/gitnexus/test/fixtures/lang-resolution/nextjs-route-mapping/components/GrantsList.tsx index 0d5fb6d05..daad565c4 100644 --- a/gitnexus/test/fixtures/lang-resolution/nextjs-route-mapping/components/GrantsList.tsx +++ b/gitnexus/test/fixtures/lang-resolution/nextjs-route-mapping/components/GrantsList.tsx @@ -1,4 +1,4 @@ export function GrantsList({ slug }: { slug: string }) { - const data = fetch(`/api/organizations/${slug}/grants`).then(r => r.json()); + const data = fetch(`/api/organizations/${slug}/grants`).then((r) => r.json()); return data; } diff --git a/gitnexus/test/fixtures/lang-resolution/nextjs-route-mapping/hooks/useGrants.ts b/gitnexus/test/fixtures/lang-resolution/nextjs-route-mapping/hooks/useGrants.ts index 1cf282562..7879bd76c 100644 --- a/gitnexus/test/fixtures/lang-resolution/nextjs-route-mapping/hooks/useGrants.ts +++ b/gitnexus/test/fixtures/lang-resolution/nextjs-route-mapping/hooks/useGrants.ts @@ -1,4 +1,4 @@ export function useGrants() { - const data = fetch('/api/grants').then(r => r.json()); + const data = fetch('/api/grants').then((r) => r.json()); return data; } diff --git a/gitnexus/test/fixtures/lang-resolution/php-abstract-dispatch/composer.json b/gitnexus/test/fixtures/lang-resolution/php-abstract-dispatch/composer.json index 1c227d048..c2ea37792 100644 --- a/gitnexus/test/fixtures/lang-resolution/php-abstract-dispatch/composer.json +++ b/gitnexus/test/fixtures/lang-resolution/php-abstract-dispatch/composer.json @@ -1 +1,7 @@ -{"autoload":{"psr-4":{"App\\\\":"src/"}}} \ No newline at end of file +{ + "autoload": { + "psr-4": { + "App\\\\": "src/" + } + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/php-assignment-chain/composer.json b/gitnexus/test/fixtures/lang-resolution/php-assignment-chain/composer.json index f36c8cd0c..386b0bd2d 100644 --- a/gitnexus/test/fixtures/lang-resolution/php-assignment-chain/composer.json +++ b/gitnexus/test/fixtures/lang-resolution/php-assignment-chain/composer.json @@ -1,7 +1,7 @@ { - "autoload": { - "psr-4": { - "App\\": "app/" - } + "autoload": { + "psr-4": { + "App\\": "app/" } + } } diff --git a/gitnexus/test/fixtures/lang-resolution/php-method-enrichment/composer.json b/gitnexus/test/fixtures/lang-resolution/php-method-enrichment/composer.json index 1c227d048..c2ea37792 100644 --- a/gitnexus/test/fixtures/lang-resolution/php-method-enrichment/composer.json +++ b/gitnexus/test/fixtures/lang-resolution/php-method-enrichment/composer.json @@ -1 +1,7 @@ -{"autoload":{"psr-4":{"App\\\\":"src/"}}} \ No newline at end of file +{ + "autoload": { + "psr-4": { + "App\\\\": "src/" + } + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/php-overload-dispatch/composer.json b/gitnexus/test/fixtures/lang-resolution/php-overload-dispatch/composer.json index 1c227d048..c2ea37792 100644 --- a/gitnexus/test/fixtures/lang-resolution/php-overload-dispatch/composer.json +++ b/gitnexus/test/fixtures/lang-resolution/php-overload-dispatch/composer.json @@ -1 +1,7 @@ -{"autoload":{"psr-4":{"App\\\\":"src/"}}} \ No newline at end of file +{ + "autoload": { + "psr-4": { + "App\\\\": "src/" + } + } +} diff --git a/gitnexus/test/fixtures/lang-resolution/php-parent-resolution/composer.json b/gitnexus/test/fixtures/lang-resolution/php-parent-resolution/composer.json index 60ede80e5..386b0bd2d 100644 --- a/gitnexus/test/fixtures/lang-resolution/php-parent-resolution/composer.json +++ b/gitnexus/test/fixtures/lang-resolution/php-parent-resolution/composer.json @@ -1,5 +1,7 @@ { "autoload": { - "psr-4": { "App\\": "app/" } + "psr-4": { + "App\\": "app/" + } } } diff --git a/gitnexus/test/fixtures/lang-resolution/php-self-this-resolution/composer.json b/gitnexus/test/fixtures/lang-resolution/php-self-this-resolution/composer.json index 60ede80e5..386b0bd2d 100644 --- a/gitnexus/test/fixtures/lang-resolution/php-self-this-resolution/composer.json +++ b/gitnexus/test/fixtures/lang-resolution/php-self-this-resolution/composer.json @@ -1,5 +1,7 @@ { "autoload": { - "psr-4": { "App\\": "app/" } + "psr-4": { + "App\\": "app/" + } } } diff --git a/gitnexus/test/fixtures/lang-resolution/php-super-resolution/composer.json b/gitnexus/test/fixtures/lang-resolution/php-super-resolution/composer.json index 60ede80e5..386b0bd2d 100644 --- a/gitnexus/test/fixtures/lang-resolution/php-super-resolution/composer.json +++ b/gitnexus/test/fixtures/lang-resolution/php-super-resolution/composer.json @@ -1,5 +1,7 @@ { "autoload": { - "psr-4": { "App\\": "app/" } + "psr-4": { + "App\\": "app/" + } } } diff --git a/gitnexus/test/fixtures/lang-resolution/python-ancestor-import/frontend/middleware.ts b/gitnexus/test/fixtures/lang-resolution/python-ancestor-import/frontend/middleware.ts index 099c3b90d..0f3466aa5 100644 --- a/gitnexus/test/fixtures/lang-resolution/python-ancestor-import/frontend/middleware.ts +++ b/gitnexus/test/fixtures/lang-resolution/python-ancestor-import/frontend/middleware.ts @@ -1,4 +1,4 @@ // TypeScript middleware — should NOT be resolved by Python imports export function handleRequest(req: Request): Response { - return new Response("ok"); + return new Response('ok'); } diff --git a/gitnexus/test/fixtures/lang-resolution/shape-check-integration/app/api/search/route.ts b/gitnexus/test/fixtures/lang-resolution/shape-check-integration/app/api/search/route.ts index e5ae8f098..739fa8846 100644 --- a/gitnexus/test/fixtures/lang-resolution/shape-check-integration/app/api/search/route.ts +++ b/gitnexus/test/fixtures/lang-resolution/shape-check-integration/app/api/search/route.ts @@ -3,5 +3,5 @@ import { NextResponse } from 'next/server'; export async function GET() { const courses = await getCourses(); const articles = await getArticles(); - return NextResponse.json({ 'courses': courses, 'articles': articles }); + return NextResponse.json({ courses: courses, articles: articles }); } diff --git a/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/GdprExport.tsx b/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/GdprExport.tsx index 97d6aec62..198214183 100644 --- a/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/GdprExport.tsx +++ b/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/GdprExport.tsx @@ -1,5 +1,5 @@ export function GdprExport() { - const data = fetch('/api/gdpr/export', { method: 'POST' }).then(r => r.json()); + const data = fetch('/api/gdpr/export', { method: 'POST' }).then((r) => r.json()); const link = document.createElement('a'); link.href = data.url; document.body.appendChild(link); diff --git a/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/SearchBar.tsx b/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/SearchBar.tsx index 854a65f26..c05e8553a 100644 --- a/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/SearchBar.tsx +++ b/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/SearchBar.tsx @@ -1,5 +1,5 @@ export function SearchBar() { - const data = fetch('/api/search').then(r => r.json()); + const data = fetch('/api/search').then((r) => r.json()); console.log(data.courses); console.log(data.articles); return null; diff --git a/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/UserList.tsx b/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/UserList.tsx index 94c849876..f7ef581f5 100644 --- a/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/UserList.tsx +++ b/gitnexus/test/fixtures/lang-resolution/shape-check-integration/components/UserList.tsx @@ -1,5 +1,5 @@ export function UserList() { - const res = fetch('/api/users').then(r => r.json()); + const res = fetch('/api/users').then((r) => r.json()); const items = res.data; const err = res.error; return null; diff --git a/gitnexus/test/fixtures/lang-resolution/ts-assignment-chain/src/app.ts b/gitnexus/test/fixtures/lang-resolution/ts-assignment-chain/src/app.ts index d8a84d558..0bea5af0f 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-assignment-chain/src/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-assignment-chain/src/app.ts @@ -1,8 +1,12 @@ import { User } from './user'; import { Repo } from './repo'; -function getUser(): User { return new User(); } -function getRepo(): Repo { return new Repo(); } +function getUser(): User { + return new User(); +} +function getRepo(): Repo { + return new Repo(); +} export function processEntities(): void { const u: User = getUser(); diff --git a/gitnexus/test/fixtures/lang-resolution/ts-grandparent-resolution/src/base.ts b/gitnexus/test/fixtures/lang-resolution/ts-grandparent-resolution/src/base.ts index 911a64970..d2a510f4a 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-grandparent-resolution/src/base.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-grandparent-resolution/src/base.ts @@ -1,5 +1,7 @@ import { Greeting } from './greeting'; export class A { - greet(): Greeting { return new Greeting(); } + greet(): Greeting { + return new Greeting(); + } } diff --git a/gitnexus/test/fixtures/lang-resolution/ts-multi-hop-chain/src/app.ts b/gitnexus/test/fixtures/lang-resolution/ts-multi-hop-chain/src/app.ts index 81e72c032..8cd7ba654 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-multi-hop-chain/src/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-multi-hop-chain/src/app.ts @@ -1,8 +1,12 @@ import { User } from './user'; import { Repo } from './repo'; -function getUser(): User { return new User(); } -function getRepo(): Repo { return new Repo(); } +function getUser(): User { + return new User(); +} +function getRepo(): Repo { + return new Repo(); +} // Multi-hop forward-declared chain: a → b → c (source order) // All three should resolve because the post-walk pass processes in order. diff --git a/gitnexus/test/fixtures/lang-resolution/ts-null-check-narrowing/src/app.ts b/gitnexus/test/fixtures/lang-resolution/ts-null-check-narrowing/src/app.ts index 2242d32df..7bf55e9e7 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-null-check-narrowing/src/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-null-check-narrowing/src/app.ts @@ -18,7 +18,7 @@ function processUndefined(x: User | undefined) { } } -const processFuncExpr = function(x: User | null) { +const processFuncExpr = function (x: User | null) { if (x !== null) { x.save(); } diff --git a/gitnexus/test/fixtures/lang-resolution/ts-nullable-chain/src/app.ts b/gitnexus/test/fixtures/lang-resolution/ts-nullable-chain/src/app.ts index 35f140d69..857e25744 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-nullable-chain/src/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-nullable-chain/src/app.ts @@ -1,8 +1,12 @@ import { User } from './user'; import { Repo } from './repo'; -function findUser(): User | null { return new User(); } -function findRepo(): Repo | undefined { return new Repo(); } +function findUser(): User | null { + return new User(); +} +function findRepo(): Repo | undefined { + return new Repo(); +} // Nullable type + assignment chain: the nullable union must be stripped // before the alias can resolve to User. diff --git a/gitnexus/test/fixtures/lang-resolution/ts-object-destructuring/src/models.ts b/gitnexus/test/fixtures/lang-resolution/ts-object-destructuring/src/models.ts index 88c11bcd0..1d4b8298b 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-object-destructuring/src/models.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-object-destructuring/src/models.ts @@ -1,6 +1,8 @@ export class Address { city: string = ''; - save(): boolean { return true; } + save(): boolean { + return true; + } } export class User { diff --git a/gitnexus/test/fixtures/lang-resolution/ts-object-destructuring/src/service.ts b/gitnexus/test/fixtures/lang-resolution/ts-object-destructuring/src/service.ts index 7ca8d0f87..fb25cd10a 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-object-destructuring/src/service.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-object-destructuring/src/service.ts @@ -1,2 +1,4 @@ import { User } from './models'; -export function getUser(): User { return new User(); } +export function getUser(): User { + return new User(); +} diff --git a/gitnexus/test/fixtures/lang-resolution/ts-optional-params/src/app.ts b/gitnexus/test/fixtures/lang-resolution/ts-optional-params/src/app.ts index 5cafe322b..ca5aaa677 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-optional-params/src/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-optional-params/src/app.ts @@ -1,5 +1,5 @@ -function greet(name: string, greeting: string = "Hello"): string { - return greeting + ", " + name; +function greet(name: string, greeting: string = 'Hello'): string { + return greeting + ', ' + name; } function search(query: string, limit?: number): string[] { @@ -7,8 +7,8 @@ function search(query: string, limit?: number): string[] { } function process() { - greet("Alice"); - greet("Bob", "Hi"); - search("test"); - search("test", 10); + greet('Alice'); + greet('Bob', 'Hi'); + search('test'); + search('test', 10); } diff --git a/gitnexus/test/fixtures/lang-resolution/ts-overload-disambiguation/src/app.ts b/gitnexus/test/fixtures/lang-resolution/ts-overload-disambiguation/src/app.ts index 76e4efc85..9ac7b9b1d 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-overload-disambiguation/src/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-overload-disambiguation/src/app.ts @@ -1,10 +1,10 @@ function lookup(id: number): string; function lookup(name: string): string; function lookup(key: number | string): string { - return String(key); + return String(key); } function process() { - lookup(42); - lookup("alice"); + lookup(42); + lookup('alice'); } diff --git a/gitnexus/test/fixtures/lang-resolution/ts-overload-dispatch/repository.ts b/gitnexus/test/fixtures/lang-resolution/ts-overload-dispatch/repository.ts index 6ad14c0da..b8fe773b4 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-overload-dispatch/repository.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-overload-dispatch/repository.ts @@ -1,5 +1,5 @@ export interface IRepository { - find(id: number): string; - find(name: string): string; - save(data: string): void; + find(id: number): string; + find(name: string): string; + save(data: string): void; } diff --git a/gitnexus/test/fixtures/lang-resolution/ts-overload-dispatch/sql-repository.ts b/gitnexus/test/fixtures/lang-resolution/ts-overload-dispatch/sql-repository.ts index e937ee689..18ca2413b 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-overload-dispatch/sql-repository.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-overload-dispatch/sql-repository.ts @@ -1,12 +1,12 @@ import { IRepository } from './repository'; export class SqlRepository implements IRepository { - find(id: number): string; - find(name: string): string; - find(arg: number | string): string { - return typeof arg === 'number' ? 'found-by-id' : 'found-by-name'; - } - save(data: string): void { - console.log(data); - } + find(id: number): string; + find(name: string): string; + find(arg: number | string): string { + return typeof arg === 'number' ? 'found-by-id' : 'found-by-name'; + } + save(data: string): void { + console.log(data); + } } diff --git a/gitnexus/test/fixtures/lang-resolution/ts-virtual-dispatch/src/app.ts b/gitnexus/test/fixtures/lang-resolution/ts-virtual-dispatch/src/app.ts index fe1df20ee..049f567af 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-virtual-dispatch/src/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-virtual-dispatch/src/app.ts @@ -19,9 +19,9 @@ class Dog extends Animal { export function run(): void { // Virtual dispatch: declared as Animal, constructed as Dog const animal: Animal = new Dog(); - animal.fetchBall(); // Only Dog has fetchBall — proves virtual dispatch override + animal.fetchBall(); // Only Dog has fetchBall — proves virtual dispatch override // Direct type: no override needed const dog: Dog = new Dog(); - dog.fetchBall(); // Direct resolution to Dog#fetchBall + dog.fetchBall(); // Direct resolution to Dog#fetchBall } diff --git a/gitnexus/test/fixtures/lang-resolution/ts-write-access/service.ts b/gitnexus/test/fixtures/lang-resolution/ts-write-access/service.ts index 4d3845af1..f05d9abed 100644 --- a/gitnexus/test/fixtures/lang-resolution/ts-write-access/service.ts +++ b/gitnexus/test/fixtures/lang-resolution/ts-write-access/service.ts @@ -2,7 +2,7 @@ import { User, Address } from './models'; function updateUser(user: User) { // Write access: user.name = "Alice" - user.name = "Alice"; + user.name = 'Alice'; // Write access: user.address = new Address() user.address = new Address(); diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/logger.ts b/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/logger.ts index 4263af297..dedcb1c86 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/logger.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/logger.ts @@ -1,7 +1,7 @@ import { ILogger } from './models'; export class ConsoleLogger implements ILogger { - log(message: string): void { - console.log(message); - } + log(message: string): void { + console.log(message); + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/models.ts b/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/models.ts index fc690b331..b1d18ff52 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/models.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/models.ts @@ -1,11 +1,11 @@ export interface ILogger { - log(message: string): void; + log(message: string): void; } export class BaseService { - protected name: string = ''; + protected name: string = ''; - getName(): string { - return this.name; - } + getName(): string { + return this.name; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/service.ts b/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/service.ts index 6bb6a5112..32a12869a 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/service.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-ambiguous/src/service.ts @@ -2,12 +2,12 @@ import { BaseService, ILogger } from './models'; import { ConsoleLogger } from './logger'; export class UserService extends BaseService implements ILogger { - log(message: string): void { - const logger = new ConsoleLogger(); - logger.log(message); - } + log(message: string): void { + const logger = new ConsoleLogger(); + logger.log(message); + } - getUsers(): string[] { - return []; - } + getUsers(): string[] { + return []; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-cast-constructor-inference/src/repo.ts b/gitnexus/test/fixtures/lang-resolution/typescript-cast-constructor-inference/src/repo.ts index 5ff21c34a..68348d685 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-cast-constructor-inference/src/repo.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-cast-constructor-inference/src/repo.ts @@ -1,3 +1,5 @@ export class Repo { - save() { return true; } + save() { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-cast-constructor-inference/src/user.ts b/gitnexus/test/fixtures/lang-resolution/typescript-cast-constructor-inference/src/user.ts index e79beaad6..1136e9d48 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-cast-constructor-inference/src/user.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-cast-constructor-inference/src/user.ts @@ -1,3 +1,5 @@ export class User { - save() { return true; } + save() { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-double-cast-inference/src/repo.ts b/gitnexus/test/fixtures/lang-resolution/typescript-double-cast-inference/src/repo.ts index 5ff21c34a..68348d685 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-double-cast-inference/src/repo.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-double-cast-inference/src/repo.ts @@ -1,3 +1,5 @@ export class Repo { - save() { return true; } + save() { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-double-cast-inference/src/user.ts b/gitnexus/test/fixtures/lang-resolution/typescript-double-cast-inference/src/user.ts index e79beaad6..1136e9d48 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-double-cast-inference/src/user.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-double-cast-inference/src/user.ts @@ -1,3 +1,5 @@ export class User { - save() { return true; } + save() { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-for-of-call-expr/models/repo.ts b/gitnexus/test/fixtures/lang-resolution/typescript-for-of-call-expr/models/repo.ts index 908aaf552..445b953bb 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-for-of-call-expr/models/repo.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-for-of-call-expr/models/repo.ts @@ -1,9 +1,11 @@ export class Repo { name: string; - constructor(name: string) { this.name = name; } + constructor(name: string) { + this.name = name; + } save(): void {} } export function getRepos(): Repo[] { - return [new Repo("main")]; + return [new Repo('main')]; } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-for-of-call-expr/models/user.ts b/gitnexus/test/fixtures/lang-resolution/typescript-for-of-call-expr/models/user.ts index 7f8334fba..d361e464c 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-for-of-call-expr/models/user.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-for-of-call-expr/models/user.ts @@ -1,9 +1,11 @@ export class User { name: string; - constructor(name: string) { this.name = name; } + constructor(name: string) { + this.name = name; + } save(): void {} } export function getUsers(): User[] { - return [new User("alice")]; + return [new User('alice')]; } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-generic-parent-resolution/src/models/Base.ts b/gitnexus/test/fixtures/lang-resolution/typescript-generic-parent-resolution/src/models/Base.ts index a560b7b98..eee8200f7 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-generic-parent-resolution/src/models/Base.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-generic-parent-resolution/src/models/Base.ts @@ -1,3 +1,5 @@ export class BaseModel { - save(): boolean { return true; } + save(): boolean { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-generic-parent-resolution/src/models/Repo.ts b/gitnexus/test/fixtures/lang-resolution/typescript-generic-parent-resolution/src/models/Repo.ts index 939092cce..daf3da894 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-generic-parent-resolution/src/models/Repo.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-generic-parent-resolution/src/models/Repo.ts @@ -1,3 +1,5 @@ export class Repo { - save(): boolean { return true; } + save(): boolean { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/app.ts b/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/app.ts index 9cfb446c0..06c002976 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/app.ts @@ -2,4 +2,4 @@ import { SqlRepository } from './sql-repository'; const repo = new SqlRepository(); repo.find(1); -repo.save("test"); +repo.save('test'); diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/repository.ts b/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/repository.ts index a86ca660a..6e5830a20 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/repository.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/repository.ts @@ -1,4 +1,4 @@ export interface IRepository { - find(id: number): string; - save(entity: string): boolean; + find(id: number): string; + save(entity: string): boolean; } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/sql-repository.ts b/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/sql-repository.ts index b623e6e9c..9f6313c27 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/sql-repository.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-interface-dispatch/sql-repository.ts @@ -1,11 +1,11 @@ import { IRepository } from './repository'; export class SqlRepository implements IRepository { - find(id: number): string { - return "found"; - } + find(id: number): string { + return 'found'; + } - save(entity: string): boolean { - return true; - } + save(entity: string): boolean { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/app.ts b/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/app.ts index 1599b2832..276128f0c 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/app.ts @@ -2,17 +2,17 @@ import { User } from './models/User'; import { Repo } from './models/Repo'; class UserService { - processUsers(users: User[]) { - for (const user of this.users) { - user.save(); - } + processUsers(users: User[]) { + for (const user of this.users) { + user.save(); } + } } class RepoService { - processRepos(repos: Repo[]) { - for (const repo of this.repos) { - repo.save(); - } + processRepos(repos: Repo[]) { + for (const repo of this.repos) { + repo.save(); } + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/models/Repo.ts b/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/models/Repo.ts index c97f1ed86..ed84b12ff 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/models/Repo.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/models/Repo.ts @@ -1,3 +1,3 @@ export class Repo { - save() {} + save() {} } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/models/User.ts b/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/models/User.ts index 265b3f05c..a464054e0 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/models/User.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-member-access-for-loop/src/models/User.ts @@ -1,3 +1,3 @@ export class User { - save() {} + save() {} } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-method-enrichment/animal.ts b/gitnexus/test/fixtures/lang-resolution/typescript-method-enrichment/animal.ts index 75a5697cd..cb1931b5e 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-method-enrichment/animal.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-method-enrichment/animal.ts @@ -1,17 +1,17 @@ export abstract class Animal { - abstract speak(): string; + abstract speak(): string; - static classify(name: string): string { - return "mammal"; - } + static classify(name: string): string { + return 'mammal'; + } - breathe(): boolean { - return true; - } + breathe(): boolean { + return true; + } } export class Dog extends Animal { - speak(): string { - return "woof"; - } + speak(): string { + return 'woof'; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-method-enrichment/app.ts b/gitnexus/test/fixtures/lang-resolution/typescript-method-enrichment/app.ts index ff2cffcd7..f4e820221 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-method-enrichment/app.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-method-enrichment/app.ts @@ -2,4 +2,4 @@ import { Animal, Dog } from './animal'; const dog = new Dog(); const sound = dog.speak(); -const category = Animal.classify("dog"); +const category = Animal.classify('dog'); diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-parent-resolution/src/models/Base.ts b/gitnexus/test/fixtures/lang-resolution/typescript-parent-resolution/src/models/Base.ts index 5717e6845..368c0725b 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-parent-resolution/src/models/Base.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-parent-resolution/src/models/Base.ts @@ -1,5 +1,7 @@ export class BaseModel { - save(): boolean { return true; } + save(): boolean { + return true; + } } export interface Serializable { diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-parent-resolution/src/models/User.ts b/gitnexus/test/fixtures/lang-resolution/typescript-parent-resolution/src/models/User.ts index 76d5c63bc..ba1a513a8 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-parent-resolution/src/models/User.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-parent-resolution/src/models/User.ts @@ -1,5 +1,7 @@ import { BaseModel, Serializable } from './Base'; export class User extends BaseModel implements Serializable { - serialize(): string { return ''; } + serialize(): string { + return ''; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-self-this-resolution/src/models/Repo.ts b/gitnexus/test/fixtures/lang-resolution/typescript-self-this-resolution/src/models/Repo.ts index 939092cce..daf3da894 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-self-this-resolution/src/models/Repo.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-self-this-resolution/src/models/Repo.ts @@ -1,3 +1,5 @@ export class Repo { - save(): boolean { return true; } + save(): boolean { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-self-this-resolution/src/models/User.ts b/gitnexus/test/fixtures/lang-resolution/typescript-self-this-resolution/src/models/User.ts index 4c8e33f09..a2c72ce8f 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-self-this-resolution/src/models/User.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-self-this-resolution/src/models/User.ts @@ -1,5 +1,7 @@ export class User { - save(): boolean { return true; } + save(): boolean { + return true; + } process(): void { this.save(); } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-super-resolution/src/models/Base.ts b/gitnexus/test/fixtures/lang-resolution/typescript-super-resolution/src/models/Base.ts index 4ac02f596..141de67a2 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-super-resolution/src/models/Base.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-super-resolution/src/models/Base.ts @@ -1,3 +1,5 @@ export class BaseModel { - save(): boolean { return true; } + save(): boolean { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/typescript-super-resolution/src/models/Repo.ts b/gitnexus/test/fixtures/lang-resolution/typescript-super-resolution/src/models/Repo.ts index 939092cce..daf3da894 100644 --- a/gitnexus/test/fixtures/lang-resolution/typescript-super-resolution/src/models/Repo.ts +++ b/gitnexus/test/fixtures/lang-resolution/typescript-super-resolution/src/models/Repo.ts @@ -1,3 +1,5 @@ export class Repo { - save(): boolean { return true; } + save(): boolean { + return true; + } } diff --git a/gitnexus/test/fixtures/lang-resolution/vue-basic/App.vue b/gitnexus/test/fixtures/lang-resolution/vue-basic/App.vue index 211d65daa..8c7a2cc62 100644 --- a/gitnexus/test/fixtures/lang-resolution/vue-basic/App.vue +++ b/gitnexus/test/fixtures/lang-resolution/vue-basic/App.vue @@ -1,9 +1,7 @@ diff --git a/gitnexus/test/fixtures/sample-code/simple.js b/gitnexus/test/fixtures/sample-code/simple.js index c9ad42470..af16b5eef 100644 --- a/gitnexus/test/fixtures/sample-code/simple.js +++ b/gitnexus/test/fixtures/sample-code/simple.js @@ -14,7 +14,7 @@ class EventEmitter { emit(event, ...args) { const handlers = this.listeners[event] || []; - handlers.forEach(handler => handler(...args)); + handlers.forEach((handler) => handler(...args)); } } diff --git a/gitnexus/test/fixtures/sample-code/simple.ts b/gitnexus/test/fixtures/sample-code/simple.ts index f7d5e6d4d..ad8deb189 100644 --- a/gitnexus/test/fixtures/sample-code/simple.ts +++ b/gitnexus/test/fixtures/sample-code/simple.ts @@ -18,7 +18,7 @@ export class UserService { } getUser(name: string): UserConfig | undefined { - return this.users.find(u => u.name === name); + return this.users.find((u) => u.name === name); } } diff --git a/gitnexus/test/fixtures/sample-code/simple.tsx b/gitnexus/test/fixtures/sample-code/simple.tsx index 698c57e67..6dc425c23 100644 --- a/gitnexus/test/fixtures/sample-code/simple.tsx +++ b/gitnexus/test/fixtures/sample-code/simple.tsx @@ -23,8 +23,8 @@ export const Button: React.FC = ({ label, onClick }) => { export function useCounter(initial: number = 0) { const [count, setCount] = useState(initial); - const increment = () => setCount(c => c + 1); - const decrement = () => setCount(c => c - 1); + const increment = () => setCount((c) => c + 1); + const decrement = () => setCount((c) => c - 1); return { count, increment, decrement }; } diff --git a/gitnexus/test/fixtures/webhook-repo/lib/realtime.ts b/gitnexus/test/fixtures/webhook-repo/lib/realtime.ts index c85afc98f..732e1068b 100644 --- a/gitnexus/test/fixtures/webhook-repo/lib/realtime.ts +++ b/gitnexus/test/fixtures/webhook-repo/lib/realtime.ts @@ -1,3 +1,5 @@ -const channel = supabase.channel('order-updates').on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'orders' }, (payload) => { - console.log(payload); -}); +const channel = supabase + .channel('order-updates') + .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'orders' }, (payload) => { + console.log(payload); + }); diff --git a/gitnexus/test/integration/webhook-detection.test.ts b/gitnexus/test/integration/webhook-detection.test.ts index 05e18bdda..28d8a37cd 100644 --- a/gitnexus/test/integration/webhook-detection.test.ts +++ b/gitnexus/test/integration/webhook-detection.test.ts @@ -20,7 +20,10 @@ import path from 'path'; import { LocalBackend } from '../../src/mcp/local/local-backend.js'; import { listRegisteredRepos } from '../../src/storage/repo-manager.js'; import { withTestLbugDB } from '../helpers/test-indexed-db.js'; -import { extractWebhooks, type ExtractedWebhook } from '../../src/core/ingestion/workers/parse-worker.js'; +import { + extractWebhooks, + type ExtractedWebhook, +} from '../../src/core/ingestion/workers/parse-worker.js'; vi.mock('../../src/storage/repo-manager.js', () => ({ listRegisteredRepos: vi.fn().mockResolvedValue([]), @@ -33,14 +36,14 @@ const WEBHOOK_REPO = path.resolve(__dirname, '..', 'fixtures', 'webhook-repo'); describe('webhook detection — extraction from fixture files', () => { const stripeContent = fs.readFileSync( - path.join(WEBHOOK_REPO, 'app/api/stripe/webhooks/route.ts'), 'utf-8' + path.join(WEBHOOK_REPO, 'app/api/stripe/webhooks/route.ts'), + 'utf-8', ); const edgeFnContent = fs.readFileSync( - path.join(WEBHOOK_REPO, 'supabase/functions/notify/index.ts'), 'utf-8' - ); - const realtimeContent = fs.readFileSync( - path.join(WEBHOOK_REPO, 'lib/realtime.ts'), 'utf-8' + path.join(WEBHOOK_REPO, 'supabase/functions/notify/index.ts'), + 'utf-8', ); + const realtimeContent = fs.readFileSync(path.join(WEBHOOK_REPO, 'lib/realtime.ts'), 'utf-8'); it('detects Stripe webhook with correct kind and eventTypes', () => { const out: ExtractedWebhook[] = []; @@ -106,135 +109,155 @@ const WEBHOOK_SEED_DATA = [ CREATE (f)-[:CodeRelation {type: 'TRIGGERS', confidence: 1.0, reason: 'webhook-handler:realtime', step: 0}]->(w)`, ]; -withTestLbugDB('webhook-persistence', (handle) => { - - describe('eventTypes survive LadybugDB round-trip', () => { - it('Stripe webhook eventTypes array is persisted and queryable', async () => { - const { executeParameterized } = await import('../../src/mcp/core/lbug-adapter.js'); - const rows = await executeParameterized(handle.repoId, ` +withTestLbugDB( + 'webhook-persistence', + (handle) => { + describe('eventTypes survive LadybugDB round-trip', () => { + it('Stripe webhook eventTypes array is persisted and queryable', async () => { + const { executeParameterized } = await import('../../src/mcp/core/lbug-adapter.js'); + const rows = await executeParameterized( + handle.repoId, + ` MATCH (w:Webhook) WHERE w.kind = $kind RETURN w.name AS name, w.eventTypes AS eventTypes - `, { kind: 'stripe' }); + `, + { kind: 'stripe' }, + ); - expect(rows).toHaveLength(1); - expect(rows[0].name).toBe('stripe-webhook'); - expect(rows[0].eventTypes).toContain('checkout.session.completed'); - expect(rows[0].eventTypes).toContain('invoice.payment_failed'); - }); + expect(rows).toHaveLength(1); + expect(rows[0].name).toBe('stripe-webhook'); + expect(rows[0].eventTypes).toContain('checkout.session.completed'); + expect(rows[0].eventTypes).toContain('invoice.payment_failed'); + }); - it('edge-function and realtime webhooks persist with empty eventTypes', async () => { - const { executeParameterized } = await import('../../src/mcp/core/lbug-adapter.js'); - const rows = await executeParameterized(handle.repoId, ` + it('edge-function and realtime webhooks persist with empty eventTypes', async () => { + const { executeParameterized } = await import('../../src/mcp/core/lbug-adapter.js'); + const rows = await executeParameterized( + handle.repoId, + ` MATCH (w:Webhook) WHERE w.kind = $kind RETURN w.name AS name, w.eventTypes AS eventTypes - `, { kind: 'edge-function' }); + `, + { kind: 'edge-function' }, + ); - expect(rows).toHaveLength(1); - expect(rows[0].name).toBe('notify'); - expect(rows[0].eventTypes).toEqual([]); - }); + expect(rows).toHaveLength(1); + expect(rows[0].name).toBe('notify'); + expect(rows[0].eventTypes).toEqual([]); + }); - it('all 3 webhook nodes survive persistence', async () => { - const { executeParameterized } = await import('../../src/mcp/core/lbug-adapter.js'); - const rows = await executeParameterized(handle.repoId, ` + it('all 3 webhook nodes survive persistence', async () => { + const { executeParameterized } = await import('../../src/mcp/core/lbug-adapter.js'); + const rows = await executeParameterized( + handle.repoId, + ` MATCH (w:Webhook) WHERE w.id STARTS WITH 'Webhook:' RETURN w.id AS id, w.kind AS kind ORDER BY w.kind - `, {}); + `, + {}, + ); - expect(rows).toHaveLength(3); - const kinds = rows.map((r: any) => r.kind); - expect(kinds).toContain('stripe'); - expect(kinds).toContain('edge-function'); - expect(kinds).toContain('realtime'); - }); + expect(rows).toHaveLength(3); + const kinds = rows.map((r: any) => r.kind); + expect(kinds).toContain('stripe'); + expect(kinds).toContain('edge-function'); + expect(kinds).toContain('realtime'); + }); - it('TRIGGERS edges survive persistence', async () => { - const { executeParameterized } = await import('../../src/mcp/core/lbug-adapter.js'); - const rows = await executeParameterized(handle.repoId, ` + it('TRIGGERS edges survive persistence', async () => { + const { executeParameterized } = await import('../../src/mcp/core/lbug-adapter.js'); + const rows = await executeParameterized( + handle.repoId, + ` MATCH (f:File)-[r:CodeRelation {type: 'TRIGGERS'}]->(w:Webhook) RETURN f.filePath AS filePath, w.name AS webhookName ORDER BY w.name - `, {}); + `, + {}, + ); - expect(rows).toHaveLength(3); - const names = rows.map((r: any) => r.webhookName); - expect(names).toContain('stripe-webhook'); - expect(names).toContain('notify'); - expect(names).toContain('realtime:order-updates'); - }); - }); - - describe('webhook_map tool reads back persisted data', () => { - let backend: LocalBackend; - - beforeAll(async () => { - const ext = handle as typeof handle & { _backend?: LocalBackend }; - if (!ext._backend) { - throw new Error('LocalBackend not initialized — afterSetup did not attach _backend to handle'); - } - backend = ext._backend; - // Trigger ensureInitialized via a cypher call — webhookMap doesn't call - // ensureInitialized itself, so the pool adapter must be warmed up first. - await backend.callTool('cypher', { query: 'MATCH (n:Webhook) RETURN count(n) AS c' }); + expect(rows).toHaveLength(3); + const names = rows.map((r: any) => r.webhookName); + expect(names).toContain('stripe-webhook'); + expect(names).toContain('notify'); + expect(names).toContain('realtime:order-updates'); + }); }); - it('returns all 3 webhooks with correct structure', async () => { - const result = await backend.callTool('webhook_map', {}); - expect(result).not.toHaveProperty('error'); - expect(result.total).toBe(3); - expect(result.webhooks).toHaveLength(3); + describe('webhook_map tool reads back persisted data', () => { + let backend: LocalBackend; - const stripe = result.webhooks.find((w: any) => w.kind === 'stripe'); - expect(stripe).toBeDefined(); - expect(stripe.name).toBe('stripe-webhook'); - expect(stripe.eventTypes).toContain('checkout.session.completed'); - expect(stripe.eventTypes).toContain('invoice.payment_failed'); + beforeAll(async () => { + const ext = handle as typeof handle & { _backend?: LocalBackend }; + if (!ext._backend) { + throw new Error( + 'LocalBackend not initialized — afterSetup did not attach _backend to handle', + ); + } + backend = ext._backend; + // Trigger ensureInitialized via a cypher call — webhookMap doesn't call + // ensureInitialized itself, so the pool adapter must be warmed up first. + await backend.callTool('cypher', { query: 'MATCH (n:Webhook) RETURN count(n) AS c' }); + }); - const edgeFn = result.webhooks.find((w: any) => w.kind === 'edge-function'); - expect(edgeFn).toBeDefined(); - expect(edgeFn.name).toBe('notify'); + it('returns all 3 webhooks with correct structure', async () => { + const result = await backend.callTool('webhook_map', {}); + expect(result).not.toHaveProperty('error'); + expect(result.total).toBe(3); + expect(result.webhooks).toHaveLength(3); - const realtime = result.webhooks.find((w: any) => w.kind === 'realtime'); - expect(realtime).toBeDefined(); - expect(realtime.name).toContain('order-updates'); + const stripe = result.webhooks.find((w: any) => w.kind === 'stripe'); + expect(stripe).toBeDefined(); + expect(stripe.name).toBe('stripe-webhook'); + expect(stripe.eventTypes).toContain('checkout.session.completed'); + expect(stripe.eventTypes).toContain('invoice.payment_failed'); + + const edgeFn = result.webhooks.find((w: any) => w.kind === 'edge-function'); + expect(edgeFn).toBeDefined(); + expect(edgeFn.name).toBe('notify'); + + const realtime = result.webhooks.find((w: any) => w.kind === 'realtime'); + expect(realtime).toBeDefined(); + expect(realtime.name).toContain('order-updates'); + }); + + it('filters by kind parameter', async () => { + const result = await backend.callTool('webhook_map', { kind: 'stripe' }); + expect(result.total).toBe(1); + expect(result.webhooks[0].kind).toBe('stripe'); + expect(result.webhooks[0].eventTypes).toContain('checkout.session.completed'); + }); + + it('filters by name parameter', async () => { + const result = await backend.callTool('webhook_map', { name: 'notify' }); + expect(result.total).toBe(1); + expect(result.webhooks[0].name).toBe('notify'); + expect(result.webhooks[0].kind).toBe('edge-function'); + }); }); - - it('filters by kind parameter', async () => { - const result = await backend.callTool('webhook_map', { kind: 'stripe' }); - expect(result.total).toBe(1); - expect(result.webhooks[0].kind).toBe('stripe'); - expect(result.webhooks[0].eventTypes).toContain('checkout.session.completed'); - }); - - it('filters by name parameter', async () => { - const result = await backend.callTool('webhook_map', { name: 'notify' }); - expect(result.total).toBe(1); - expect(result.webhooks[0].name).toBe('notify'); - expect(result.webhooks[0].kind).toBe('edge-function'); - }); - }); - -}, { - seed: WEBHOOK_SEED_DATA, - poolAdapter: true, - afterSetup: async (handle) => { - vi.mocked(listRegisteredRepos).mockResolvedValue([ - { - name: 'webhook-test-repo', - path: '/test/webhook-repo', - storagePath: handle.tmpHandle.dbPath, - indexedAt: new Date().toISOString(), - lastCommit: 'webhook123', - stats: { files: 3, nodes: 6, communities: 0, processes: 0 }, - }, - ]); - - const backend = new LocalBackend(); - await backend.init(); - (handle as any)._backend = backend; }, -}); + { + seed: WEBHOOK_SEED_DATA, + poolAdapter: true, + afterSetup: async (handle) => { + vi.mocked(listRegisteredRepos).mockResolvedValue([ + { + name: 'webhook-test-repo', + path: '/test/webhook-repo', + storagePath: handle.tmpHandle.dbPath, + indexedAt: new Date().toISOString(), + lastCommit: 'webhook123', + stats: { files: 3, nodes: 6, communities: 0, processes: 0 }, + }, + ]); + + const backend = new LocalBackend(); + await backend.init(); + (handle as any)._backend = backend; + }, + }, +); diff --git a/gitnexus/vendor/leiden/index.cjs b/gitnexus/vendor/leiden/index.cjs index 86dab8738..c521f3d2d 100644 --- a/gitnexus/vendor/leiden/index.cjs +++ b/gitnexus/vendor/leiden/index.cjs @@ -29,210 +29,199 @@ var UndirectedLouvainIndex = indices.UndirectedLouvainIndex; var UndirectedLeidenAddenda = utils.UndirectedLeidenAddenda; var DEFAULTS = { - attributes: { - community: 'community', - weight: 'weight' - }, - randomness: 0.01, - randomWalk: true, - resolution: 1, - rng: Math.random, - weighted: false + attributes: { + community: 'community', + weight: 'weight', + }, + randomness: 0.01, + randomWalk: true, + resolution: 1, + rng: Math.random, + weighted: false, }; var EPSILON = 1e-10; -function tieBreaker( - bestCommunity, - currentCommunity, - targetCommunity, - delta, - bestDelta -) { - if (Math.abs(delta - bestDelta) < EPSILON) { - if (bestCommunity === currentCommunity) { - return false; - } else { - return targetCommunity > bestCommunity; - } - } else if (delta > bestDelta) { - return true; - } +function tieBreaker(bestCommunity, currentCommunity, targetCommunity, delta, bestDelta) { + if (Math.abs(delta - bestDelta) < EPSILON) { + if (bestCommunity === currentCommunity) { + return false; + } else { + return targetCommunity > bestCommunity; + } + } else if (delta > bestDelta) { + return true; + } - return false; + return false; } function undirectedLeiden(detailed, graph, options) { - var index = new UndirectedLouvainIndex(graph, { - attributes: { - weight: options.attributes.weight - }, - keepDendrogram: detailed, - resolution: options.resolution, - weighted: options.weighted - }); + var index = new UndirectedLouvainIndex(graph, { + attributes: { + weight: options.attributes.weight, + }, + keepDendrogram: detailed, + resolution: options.resolution, + weighted: options.weighted, + }); - var addenda = new UndirectedLeidenAddenda(index, { - randomness: options.randomness, - rng: options.rng - }); + var addenda = new UndirectedLeidenAddenda(index, { + randomness: options.randomness, + rng: options.rng, + }); - var randomIndex = createRandomIndex(options.rng); + var randomIndex = createRandomIndex(options.rng); - // Communities - var currentCommunity, targetCommunity; - var communities = new SparseMap(Float64Array, index.C); + // Communities + var currentCommunity, targetCommunity; + var communities = new SparseMap(Float64Array, index.C); - // Traversal - var queue = new SparseQueueSet(index.C), - start, - end, - weight, - ci, - ri, - s, - i, - j, - l; + // Traversal + var queue = new SparseQueueSet(index.C), + start, + end, + weight, + ci, + ri, + s, + i, + j, + l; - // Metrics - var degree, targetCommunityDegree; + // Metrics + var degree, targetCommunityDegree; - // Moves - var bestCommunity, bestDelta, deltaIsBetter, delta; + // Moves + var bestCommunity, bestDelta, deltaIsBetter, delta; - // Details - var deltaComputations = 0, - nodesVisited = 0, - moves = [], - currentMoves; + // Details + var deltaComputations = 0, + nodesVisited = 0, + moves = [], + currentMoves; - while (true) { - l = index.C; + while (true) { + l = index.C; - currentMoves = 0; + currentMoves = 0; - // Traversal of the graph - ri = options.randomWalk ? randomIndex(l) : 0; + // Traversal of the graph + ri = options.randomWalk ? randomIndex(l) : 0; - for (s = 0; s < l; s++, ri++) { - i = ri % l; - queue.enqueue(i); - } + for (s = 0; s < l; s++, ri++) { + i = ri % l; + queue.enqueue(i); + } - while (queue.size !== 0) { - i = queue.dequeue(); - nodesVisited++; + while (queue.size !== 0) { + i = queue.dequeue(); + nodesVisited++; - degree = 0; - communities.clear(); + degree = 0; + communities.clear(); - currentCommunity = index.belongings[i]; + currentCommunity = index.belongings[i]; - start = index.starts[i]; - end = index.starts[i + 1]; + start = index.starts[i]; + end = index.starts[i + 1]; - // Traversing neighbors - for (; start < end; start++) { - j = index.neighborhood[start]; - weight = index.weights[start]; + // Traversing neighbors + for (; start < end; start++) { + j = index.neighborhood[start]; + weight = index.weights[start]; - targetCommunity = index.belongings[j]; + targetCommunity = index.belongings[j]; - // Incrementing metrics - degree += weight; - addWeightToCommunity(communities, targetCommunity, weight); - } + // Incrementing metrics + degree += weight; + addWeightToCommunity(communities, targetCommunity, weight); + } - // Finding best community to move to - bestDelta = index.fastDeltaWithOwnCommunity( - i, - degree, - communities.get(currentCommunity) || 0, - currentCommunity - ); - bestCommunity = currentCommunity; + // Finding best community to move to + bestDelta = index.fastDeltaWithOwnCommunity( + i, + degree, + communities.get(currentCommunity) || 0, + currentCommunity, + ); + bestCommunity = currentCommunity; - for (ci = 0; ci < communities.size; ci++) { - targetCommunity = communities.dense[ci]; + for (ci = 0; ci < communities.size; ci++) { + targetCommunity = communities.dense[ci]; - if (targetCommunity === currentCommunity) continue; + if (targetCommunity === currentCommunity) continue; - targetCommunityDegree = communities.vals[ci]; + targetCommunityDegree = communities.vals[ci]; - deltaComputations++; + deltaComputations++; - delta = index.fastDelta( - i, - degree, - targetCommunityDegree, - targetCommunity - ); + delta = index.fastDelta(i, degree, targetCommunityDegree, targetCommunity); - deltaIsBetter = tieBreaker( - bestCommunity, - currentCommunity, - targetCommunity, - delta, - bestDelta - ); + deltaIsBetter = tieBreaker( + bestCommunity, + currentCommunity, + targetCommunity, + delta, + bestDelta, + ); - if (deltaIsBetter) { - bestDelta = delta; - bestCommunity = targetCommunity; - } - } + if (deltaIsBetter) { + bestDelta = delta; + bestCommunity = targetCommunity; + } + } - if (bestDelta < 0) { - bestCommunity = index.isolate(i, degree); + if (bestDelta < 0) { + bestCommunity = index.isolate(i, degree); - if (bestCommunity === currentCommunity) continue; - } else { - if (bestCommunity === currentCommunity) { - continue; - } else { - index.move(i, degree, bestCommunity); - } - } + if (bestCommunity === currentCommunity) continue; + } else { + if (bestCommunity === currentCommunity) { + continue; + } else { + index.move(i, degree, bestCommunity); + } + } - currentMoves++; + currentMoves++; - // Adding neighbors from other communities to the queue - start = index.starts[i]; - end = index.starts[i + 1]; + // Adding neighbors from other communities to the queue + start = index.starts[i]; + end = index.starts[i + 1]; - for (; start < end; start++) { - j = index.neighborhood[start]; - targetCommunity = index.belongings[j]; + for (; start < end; start++) { + j = index.neighborhood[start]; + targetCommunity = index.belongings[j]; - if (targetCommunity !== bestCommunity) queue.enqueue(j); - } - } + if (targetCommunity !== bestCommunity) queue.enqueue(j); + } + } - moves.push(currentMoves); + moves.push(currentMoves); - if (currentMoves === 0) { - index.zoomOut(); - break; - } + if (currentMoves === 0) { + index.zoomOut(); + break; + } - if (!addenda.onlySingletons()) { - // We continue working on the induced graph - addenda.zoomOut(); - continue; - } + if (!addenda.onlySingletons()) { + // We continue working on the induced graph + addenda.zoomOut(); + continue; + } - break; - } + break; + } - var results = { - index: index, - deltaComputations: deltaComputations, - nodesVisited: nodesVisited, - moves: moves - }; + var results = { + index: index, + deltaComputations: deltaComputations, + nodesVisited: nodesVisited, + moves: moves, + }; - return results; + return results; } /** @@ -253,95 +242,93 @@ function undirectedLeiden(detailed, graph, options) { * @return {object} */ function leiden(assign, detailed, graph, options) { - if (!isGraph(graph)) - throw new Error( - 'graphology-communities-leiden: the given graph is not a valid graphology instance.' - ); + if (!isGraph(graph)) + throw new Error( + 'graphology-communities-leiden: the given graph is not a valid graphology instance.', + ); - var type = inferType(graph); + var type = inferType(graph); - if (type === 'mixed') - throw new Error( - 'graphology-communities-leiden: cannot run the algorithm on a true mixed graph.' - ); + if (type === 'mixed') + throw new Error( + 'graphology-communities-leiden: cannot run the algorithm on a true mixed graph.', + ); - if (type === 'directed') - throw new Error( - 'graphology-communities-leiden: not yet implemented for directed graphs.' - ); + if (type === 'directed') + throw new Error('graphology-communities-leiden: not yet implemented for directed graphs.'); - // Attributes name - options = resolveDefaults(options, DEFAULTS); + // Attributes name + options = resolveDefaults(options, DEFAULTS); - // Empty graph case - var c = 0; + // Empty graph case + var c = 0; - if (graph.size === 0) { - if (assign) { - graph.forEachNode(function (node) { - graph.setNodeAttribute(node, options.attributes.communities, c++); - }); + if (graph.size === 0) { + if (assign) { + graph.forEachNode(function (node) { + graph.setNodeAttribute(node, options.attributes.communities, c++); + }); - return; - } + return; + } - var communities = {}; + var communities = {}; - graph.forEachNode(function (node) { - communities[node] = c++; - }); + graph.forEachNode(function (node) { + communities[node] = c++; + }); - if (!detailed) return communities; + if (!detailed) return communities; - return { - communities: communities, - count: graph.order, - deltaComputations: 0, - dendrogram: null, - level: 0, - modularity: NaN, - moves: null, - nodesVisited: 0, - resolution: options.resolution - }; - } + return { + communities: communities, + count: graph.order, + deltaComputations: 0, + dendrogram: null, + level: 0, + modularity: NaN, + moves: null, + nodesVisited: 0, + resolution: options.resolution, + }; + } - var fn = undirectedLeiden; + var fn = undirectedLeiden; - var results = fn(detailed, graph, options); + var results = fn(detailed, graph, options); - var index = results.index; + var index = results.index; - // Standard output - if (!detailed) { - if (assign) { - index.assign(options.attributes.community); - return; - } + // Standard output + if (!detailed) { + if (assign) { + index.assign(options.attributes.community); + return; + } - return index.collect(); - } + return index.collect(); + } - // Detailed output - var output = { - count: index.C, - deltaComputations: results.deltaComputations, - dendrogram: index.dendrogram, - level: index.level, - modularity: index.modularity(), - moves: results.moves, - nodesVisited: results.nodesVisited, - resolution: options.resolution - }; + // Detailed output + var output = { + count: index.C, + deltaComputations: results.deltaComputations, + dendrogram: index.dendrogram, + level: index.level, + modularity: index.modularity(), + moves: results.moves, + nodesVisited: results.nodesVisited, + resolution: options.resolution, + }; - if (assign) { - index.assign(options.attributes.community); - return output; - } + if (assign) { + index.assign(options.attributes.community); + return output; + } - output.communities = index.collect(); + output.communities = index.collect(); - return output; + return output; } /** diff --git a/gitnexus/vendor/leiden/utils.cjs b/gitnexus/vendor/leiden/utils.cjs index b6c6132da..8484d92f6 100644 --- a/gitnexus/vendor/leiden/utils.cjs +++ b/gitnexus/vendor/leiden/utils.cjs @@ -11,381 +11,371 @@ var SparseMap = require('mnemonist/sparse-map'); var createRandom = require('pandemonium/random').createRandom; function addWeightToCommunity(map, community, weight) { - var currentWeight = map.get(community); + var currentWeight = map.get(community); - if (typeof currentWeight === 'undefined') currentWeight = 0; + if (typeof currentWeight === 'undefined') currentWeight = 0; - currentWeight += weight; + currentWeight += weight; - map.set(community, currentWeight); + map.set(community, currentWeight); } function UndirectedLeidenAddenda(index, options) { - options = options || {}; + options = options || {}; - var rng = options.rng || Math.random; - var randomness = 'randomness' in options ? options.randomness : 0.01; + var rng = options.rng || Math.random; + var randomness = 'randomness' in options ? options.randomness : 0.01; - this.index = index; - this.random = createRandom(rng); - this.randomness = randomness; - this.rng = rng; + this.index = index; + this.random = createRandom(rng); + this.randomness = randomness; + this.rng = rng; - var NodesPointerArray = index.counts.constructor; - var WeightsArray = index.weights.constructor; + var NodesPointerArray = index.counts.constructor; + var WeightsArray = index.weights.constructor; - var order = index.C; - this.resolution = index.resolution; + var order = index.C; + this.resolution = index.resolution; - // Used to group nodes by communities - this.B = index.C; - this.C = 0; - this.communitiesOffsets = new NodesPointerArray(order); - this.nodesSortedByCommunities = new NodesPointerArray(order); - this.communitiesBounds = new NodesPointerArray(order + 1); + // Used to group nodes by communities + this.B = index.C; + this.C = 0; + this.communitiesOffsets = new NodesPointerArray(order); + this.nodesSortedByCommunities = new NodesPointerArray(order); + this.communitiesBounds = new NodesPointerArray(order + 1); - // Used to merge nodes subsets - this.communityWeights = new WeightsArray(order); - this.degrees = new WeightsArray(order); - this.nonSingleton = new Uint8Array(order); - this.externalEdgeWeightPerCommunity = new WeightsArray(order); - this.belongings = new NodesPointerArray(order); - this.neighboringCommunities = new SparseMap(WeightsArray, order); - this.cumulativeIncrement = new Float64Array(order); - this.macroCommunities = null; + // Used to merge nodes subsets + this.communityWeights = new WeightsArray(order); + this.degrees = new WeightsArray(order); + this.nonSingleton = new Uint8Array(order); + this.externalEdgeWeightPerCommunity = new WeightsArray(order); + this.belongings = new NodesPointerArray(order); + this.neighboringCommunities = new SparseMap(WeightsArray, order); + this.cumulativeIncrement = new Float64Array(order); + this.macroCommunities = null; } UndirectedLeidenAddenda.prototype.groupByCommunities = function () { - var index = this.index; + var index = this.index; - var n, i, c, b, o; + var n, i, c, b, o; - n = 0; - o = 0; + n = 0; + o = 0; - for (i = 0; i < index.C; i++) { - c = index.counts[i]; + for (i = 0; i < index.C; i++) { + c = index.counts[i]; - if (c !== 0) { - this.communitiesBounds[o++] = n; - n += c; - this.communitiesOffsets[i] = n; - } - } + if (c !== 0) { + this.communitiesBounds[o++] = n; + n += c; + this.communitiesOffsets[i] = n; + } + } - this.communitiesBounds[o] = n; + this.communitiesBounds[o] = n; - o = 0; + o = 0; - for (i = 0; i < index.C; i++) { - b = index.belongings[i]; - o = --this.communitiesOffsets[b]; - this.nodesSortedByCommunities[o] = i; - } + for (i = 0; i < index.C; i++) { + b = index.belongings[i]; + o = --this.communitiesOffsets[b]; + this.nodesSortedByCommunities[o] = i; + } - this.B = index.C - index.U; - this.C = index.C; + this.B = index.C - index.U; + this.C = index.C; }; UndirectedLeidenAddenda.prototype.communities = function () { - var communities = new Array(this.B); + var communities = new Array(this.B); - var i, j, community, start, stop; + var i, j, community, start, stop; - for (i = 0; i < this.B; i++) { - start = this.communitiesBounds[i]; - stop = this.communitiesBounds[i + 1]; - community = []; + for (i = 0; i < this.B; i++) { + start = this.communitiesBounds[i]; + stop = this.communitiesBounds[i + 1]; + community = []; - for (j = start; j < stop; j++) { - community.push(j); - } + for (j = start; j < stop; j++) { + community.push(j); + } - communities[i] = community; - } + communities[i] = community; + } - return communities; + return communities; }; UndirectedLeidenAddenda.prototype.mergeNodesSubset = function (start, stop) { - var index = this.index; - var currentMacroCommunity = - index.belongings[this.nodesSortedByCommunities[start]]; - var neighboringCommunities = this.neighboringCommunities; + var index = this.index; + var currentMacroCommunity = index.belongings[this.nodesSortedByCommunities[start]]; + var neighboringCommunities = this.neighboringCommunities; - var totalNodeWeight = 0; + var totalNodeWeight = 0; - var i, j, w; - var ei, el, et; + var i, j, w; + var ei, el, et; - // Initializing singletons - for (j = start; j < stop; j++) { - i = this.nodesSortedByCommunities[j]; + // Initializing singletons + for (j = start; j < stop; j++) { + i = this.nodesSortedByCommunities[j]; - this.belongings[i] = i; - this.nonSingleton[i] = 0; - this.degrees[i] = 0; - totalNodeWeight += index.loops[i] / 2; + this.belongings[i] = i; + this.nonSingleton[i] = 0; + this.degrees[i] = 0; + totalNodeWeight += index.loops[i] / 2; - this.communityWeights[i] = index.loops[i]; - this.externalEdgeWeightPerCommunity[i] = 0; + this.communityWeights[i] = index.loops[i]; + this.externalEdgeWeightPerCommunity[i] = 0; - ei = index.starts[i]; - el = index.starts[i + 1]; + ei = index.starts[i]; + el = index.starts[i + 1]; - for (; ei < el; ei++) { - et = index.neighborhood[ei]; - w = index.weights[ei]; + for (; ei < el; ei++) { + et = index.neighborhood[ei]; + w = index.weights[ei]; - this.degrees[i] += w; + this.degrees[i] += w; - if (index.belongings[et] !== currentMacroCommunity) continue; + if (index.belongings[et] !== currentMacroCommunity) continue; - totalNodeWeight += w; - this.externalEdgeWeightPerCommunity[i] += w; - this.communityWeights[i] += w; - } - } + totalNodeWeight += w; + this.externalEdgeWeightPerCommunity[i] += w; + this.communityWeights[i] += w; + } + } - var microDegrees = this.externalEdgeWeightPerCommunity.slice(); + var microDegrees = this.externalEdgeWeightPerCommunity.slice(); - var s, ri, ci; - var order = stop - start; + var s, ri, ci; + var order = stop - start; - var degree, - bestCommunity, - qualityValueIncrement, - maxQualityValueIncrement, - totalTransformedQualityValueIncrement, - targetCommunity, - targetCommunityDegree, - targetCommunityWeight; + var degree, + bestCommunity, + qualityValueIncrement, + maxQualityValueIncrement, + totalTransformedQualityValueIncrement, + targetCommunity, + targetCommunityDegree, + targetCommunityWeight; - var r, lo, hi, mid, chosenCommunity; + var r, lo, hi, mid, chosenCommunity; - ri = this.random(start, stop - 1); + ri = this.random(start, stop - 1); - for (s = start; s < stop; s++, ri++) { - j = start + (ri % order); + for (s = start; s < stop; s++, ri++) { + j = start + (ri % order); - i = this.nodesSortedByCommunities[j]; + i = this.nodesSortedByCommunities[j]; - if (this.nonSingleton[i] === 1) { - continue; - } + if (this.nonSingleton[i] === 1) { + continue; + } - if ( - this.externalEdgeWeightPerCommunity[i] < - this.communityWeights[i] * - (totalNodeWeight / 2 - this.communityWeights[i]) * - this.resolution - ) { - continue; - } + if ( + this.externalEdgeWeightPerCommunity[i] < + this.communityWeights[i] * (totalNodeWeight / 2 - this.communityWeights[i]) * this.resolution + ) { + continue; + } - this.communityWeights[i] = 0; - this.externalEdgeWeightPerCommunity[i] = 0; + this.communityWeights[i] = 0; + this.externalEdgeWeightPerCommunity[i] = 0; - neighboringCommunities.clear(); - neighboringCommunities.set(i, 0); + neighboringCommunities.clear(); + neighboringCommunities.set(i, 0); - degree = 0; + degree = 0; - ei = index.starts[i]; - el = index.starts[i + 1]; + ei = index.starts[i]; + el = index.starts[i + 1]; - for (; ei < el; ei++) { - et = index.neighborhood[ei]; + for (; ei < el; ei++) { + et = index.neighborhood[ei]; - if (index.belongings[et] !== currentMacroCommunity) continue; + if (index.belongings[et] !== currentMacroCommunity) continue; - w = index.weights[ei]; + w = index.weights[ei]; - degree += w; + degree += w; - addWeightToCommunity(neighboringCommunities, this.belongings[et], w); - } + addWeightToCommunity(neighboringCommunities, this.belongings[et], w); + } - bestCommunity = i; - maxQualityValueIncrement = 0; - totalTransformedQualityValueIncrement = 0; + bestCommunity = i; + maxQualityValueIncrement = 0; + totalTransformedQualityValueIncrement = 0; - for (ci = 0; ci < neighboringCommunities.size; ci++) { - targetCommunity = neighboringCommunities.dense[ci]; - targetCommunityDegree = neighboringCommunities.vals[ci]; - targetCommunityWeight = this.communityWeights[targetCommunity]; + for (ci = 0; ci < neighboringCommunities.size; ci++) { + targetCommunity = neighboringCommunities.dense[ci]; + targetCommunityDegree = neighboringCommunities.vals[ci]; + targetCommunityWeight = this.communityWeights[targetCommunity]; - if ( - this.externalEdgeWeightPerCommunity[targetCommunity] >= - targetCommunityWeight * - (totalNodeWeight / 2 - targetCommunityWeight) * - this.resolution - ) { - qualityValueIncrement = - targetCommunityDegree - - ((degree + index.loops[i]) * - targetCommunityWeight * - this.resolution) / - totalNodeWeight; + if ( + this.externalEdgeWeightPerCommunity[targetCommunity] >= + targetCommunityWeight * (totalNodeWeight / 2 - targetCommunityWeight) * this.resolution + ) { + qualityValueIncrement = + targetCommunityDegree - + ((degree + index.loops[i]) * targetCommunityWeight * this.resolution) / totalNodeWeight; - if (qualityValueIncrement > maxQualityValueIncrement) { - bestCommunity = targetCommunity; - maxQualityValueIncrement = qualityValueIncrement; - } + if (qualityValueIncrement > maxQualityValueIncrement) { + bestCommunity = targetCommunity; + maxQualityValueIncrement = qualityValueIncrement; + } - if (qualityValueIncrement >= 0) - totalTransformedQualityValueIncrement += Math.exp( - qualityValueIncrement / this.randomness - ); - } + if (qualityValueIncrement >= 0) + totalTransformedQualityValueIncrement += Math.exp( + qualityValueIncrement / this.randomness, + ); + } - this.cumulativeIncrement[ci] = totalTransformedQualityValueIncrement; - } + this.cumulativeIncrement[ci] = totalTransformedQualityValueIncrement; + } - if ( - totalTransformedQualityValueIncrement < Number.MAX_VALUE && - totalTransformedQualityValueIncrement < Infinity - ) { - r = totalTransformedQualityValueIncrement * this.rng(); - lo = -1; - hi = neighboringCommunities.size + 1; + if ( + totalTransformedQualityValueIncrement < Number.MAX_VALUE && + totalTransformedQualityValueIncrement < Infinity + ) { + r = totalTransformedQualityValueIncrement * this.rng(); + lo = -1; + hi = neighboringCommunities.size + 1; - while (lo < hi - 1) { - mid = (lo + hi) >>> 1; + while (lo < hi - 1) { + mid = (lo + hi) >>> 1; - if (this.cumulativeIncrement[mid] >= r) hi = mid; - else lo = mid; - } + if (this.cumulativeIncrement[mid] >= r) hi = mid; + else lo = mid; + } - chosenCommunity = neighboringCommunities.dense[hi]; - } else { - chosenCommunity = bestCommunity; - } + chosenCommunity = neighboringCommunities.dense[hi]; + } else { + chosenCommunity = bestCommunity; + } - this.communityWeights[chosenCommunity] += degree + index.loops[i]; + this.communityWeights[chosenCommunity] += degree + index.loops[i]; - ei = index.starts[i]; - el = index.starts[i + 1]; + ei = index.starts[i]; + el = index.starts[i + 1]; - for (; ei < el; ei++) { - et = index.neighborhood[ei]; + for (; ei < el; ei++) { + et = index.neighborhood[ei]; - if (index.belongings[et] !== currentMacroCommunity) continue; + if (index.belongings[et] !== currentMacroCommunity) continue; - targetCommunity = this.belongings[et]; + targetCommunity = this.belongings[et]; - if (targetCommunity === chosenCommunity) { - this.externalEdgeWeightPerCommunity[chosenCommunity] -= - microDegrees[et]; - } else { - this.externalEdgeWeightPerCommunity[chosenCommunity] += - microDegrees[et]; - } - } + if (targetCommunity === chosenCommunity) { + this.externalEdgeWeightPerCommunity[chosenCommunity] -= microDegrees[et]; + } else { + this.externalEdgeWeightPerCommunity[chosenCommunity] += microDegrees[et]; + } + } - if (chosenCommunity !== i) { - this.belongings[i] = chosenCommunity; - this.nonSingleton[chosenCommunity] = 1; - this.C--; - } - } + if (chosenCommunity !== i) { + this.belongings[i] = chosenCommunity; + this.nonSingleton[chosenCommunity] = 1; + this.C--; + } + } - var microCommunities = this.neighboringCommunities; - microCommunities.clear(); + var microCommunities = this.neighboringCommunities; + microCommunities.clear(); - for (j = start; j < stop; j++) { - i = this.nodesSortedByCommunities[j]; - microCommunities.set(this.belongings[i], 1); - } + for (j = start; j < stop; j++) { + i = this.nodesSortedByCommunities[j]; + microCommunities.set(this.belongings[i], 1); + } - return microCommunities.dense.slice(0, microCommunities.size); + return microCommunities.dense.slice(0, microCommunities.size); }; UndirectedLeidenAddenda.prototype.refinePartition = function () { - this.groupByCommunities(); + this.groupByCommunities(); - this.macroCommunities = new Array(this.B); + this.macroCommunities = new Array(this.B); - var i, start, stop, mapping; + var i, start, stop, mapping; - var bounds = this.communitiesBounds; + var bounds = this.communitiesBounds; - for (i = 0; i < this.B; i++) { - start = bounds[i]; - stop = bounds[i + 1]; + for (i = 0; i < this.B; i++) { + start = bounds[i]; + stop = bounds[i + 1]; - mapping = this.mergeNodesSubset(start, stop); - this.macroCommunities[i] = mapping; - } + mapping = this.mergeNodesSubset(start, stop); + this.macroCommunities[i] = mapping; + } }; UndirectedLeidenAddenda.prototype.split = function () { - var index = this.index; - var isolates = this.neighboringCommunities; + var index = this.index; + var isolates = this.neighboringCommunities; - isolates.clear(); + isolates.clear(); - var i, community, isolated; + var i, community, isolated; - for (i = 0; i < index.C; i++) { - community = this.belongings[i]; + for (i = 0; i < index.C; i++) { + community = this.belongings[i]; - if (i !== community) continue; + if (i !== community) continue; - isolated = index.isolate(i, this.degrees[i]); - isolates.set(community, isolated); - } + isolated = index.isolate(i, this.degrees[i]); + isolates.set(community, isolated); + } - for (i = 0; i < index.C; i++) { - community = this.belongings[i]; + for (i = 0; i < index.C; i++) { + community = this.belongings[i]; - if (i === community) continue; + if (i === community) continue; - isolated = isolates.get(community); - index.move(i, this.degrees[i], isolated); - } + isolated = isolates.get(community); + index.move(i, this.degrees[i], isolated); + } - var j, macro; + var j, macro; - for (i = 0; i < this.macroCommunities.length; i++) { - macro = this.macroCommunities[i]; + for (i = 0; i < this.macroCommunities.length; i++) { + macro = this.macroCommunities[i]; - for (j = 0; j < macro.length; j++) macro[j] = isolates.get(macro[j]); - } + for (j = 0; j < macro.length; j++) macro[j] = isolates.get(macro[j]); + } }; UndirectedLeidenAddenda.prototype.zoomOut = function () { - var index = this.index; - this.refinePartition(); - this.split(); + var index = this.index; + this.refinePartition(); + this.split(); - var newLabels = index.zoomOut(); + var newLabels = index.zoomOut(); - var macro, leader, follower; + var macro, leader, follower; - var i, j; + var i, j; - for (i = 0; i < this.macroCommunities.length; i++) { - macro = this.macroCommunities[i]; - leader = newLabels[macro[0]]; + for (i = 0; i < this.macroCommunities.length; i++) { + macro = this.macroCommunities[i]; + leader = newLabels[macro[0]]; - for (j = 1; j < macro.length; j++) { - follower = newLabels[macro[j]]; - index.expensiveMove(follower, leader); - } - } + for (j = 1; j < macro.length; j++) { + follower = newLabels[macro[j]]; + index.expensiveMove(follower, leader); + } + } }; UndirectedLeidenAddenda.prototype.onlySingletons = function () { - var index = this.index; + var index = this.index; - var i; + var i; - for (i = 0; i < index.C; i++) { - if (index.counts[i] > 1) return false; - } + for (i = 0; i < index.C; i++) { + if (index.counts[i] > 1) return false; + } - return true; + return true; }; exports.addWeightToCommunity = addWeightToCommunity; diff --git a/package-lock.json b/package-lock.json index 65c0870ed..2ff9dd273 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,6 +49,7 @@ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", @@ -603,6 +604,7 @@ "integrity": "sha512-NZZgp0Fm2IkD+La5PR81sd+g+8oS6JwJje+aRWsDocxHkjyRw0J5L5ZTlN3LI1LlOcGL7ph3eaIUmTXMIjLk0w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.57.2", @@ -632,6 +634,7 @@ "integrity": "sha512-30ScMRHIAD33JJQkgfGW1t8CURZtjc2JpTrq5n2HFhOefbAhb7ucc7xJwdWcrEtqUIYJ73Nybpsggii6GtAHjA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.57.2", "@typescript-eslint/types": "8.57.2", @@ -836,6 +839,7 @@ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -988,6 +992,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -1226,6 +1231,7 @@ "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -2357,6 +2363,7 @@ "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -2696,6 +2703,7 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -2884,6 +2892,7 @@ "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" }