GitNexus/gitnexus/test
Garrett Griffin-Morales 91f680ec8e feat(languages/zig): resolve build.zig.zon package imports
Bare-name @import("pkg") calls in Zig refer to dependencies declared in
build.zig.zon. Previously these returned null and fell through to the
generic suffix matcher, which could only resolve them by accident.

This adds:
- A `loadZigBuildZon` config loader that parses build.zig.zon at the
  repo root and extracts `.path = "..."` dependency mappings into a
  per-run ZigBuildZonConfig.
- A regex-based parser (`parseZigBuildZon`) over the .zon source — a
  small anonymous-struct literal — rather than pulling in tree-sitter
  for one file. Limitations are documented inline; the parser handles
  the two common shapes (`.path` and `.url + .hash`) and bails to null
  on anything weirder.
- Resolver wiring in `resolveZigImportInternal` that, given a parsed
  ZigBuildZonConfig, tries the conventional Zig package layout
  (`<dep_root>/src/<name>.zig`, then `<dep_root>/src/main.zig`).

`.url`-based deps unpack into a build cache outside the repo
(.zig-cache/p/<hash>/) and so can't be resolved against repo-local
files; those bare names continue to return null cleanly. `.path` deps
that escape the repo root (`..`) are also rejected to avoid pointing
at files outside `allFilePaths`.

Tests:
- Unit coverage for `resolveZigImportInternal` (10 cases — relative
  paths, parent traversal, bare-name dep resolution with both
  `<name>.zig` and `main.zig` layouts, escape-the-repo rejection).
- Unit coverage for `parseZigBuildZon` (3 cases — mixed `.path`/`.url`
  block, missing deps block, deps with no `.path` entries).
- The pre-existing `csharpConfigs: []` test contexts gain a
  `zigBuildZon: null` field to match the widened `ImportConfigs`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 18:37:40 -04:00
..
fixtures feat(languages): add Zig language provider 2026-04-26 18:32:07 -04:00
helpers Fix security issues and critical bugs found in code review (#709) 2026-04-10 05:20:29 +01:00
integration feat(languages): add Zig language provider 2026-04-26 18:32:07 -04:00
unit feat(languages/zig): resolve build.zig.zon package imports 2026-04-26 18:37:40 -04:00
utils ci: add macOS to cross-platform test matrix (#208) 2026-03-07 10:38:32 +00:00
global-setup.ts feat: upgrade @ladybugdb/core to 0.15.2 and remove segfault workarounds (#374) 2026-03-19 08:25:43 +00:00
vitest.d.ts refactor: migrate from KuzuDB to LadybugDB v0.15 (#275) 2026-03-15 15:53:01 +00:00