Enhancement: link Go modules in the same repository through `go.work` and local `replace` paths

Đang mở
#666 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@vibgrate-team đang làm issue này rồi.

Từ ngày 12/11/2026.

  • #671 của @vibgrate-team — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go, typescript
Lĩnh vực
data, devtools

Hướng nghiên cứu

Read src/core-open/scanners/go-scanner.ts and the existing Maven and npm workspace reference handling. Start by tracing how local replace paths are parsed and matched to scanned Go projects; the issue names no test file, so locate the Go scanner fixtures and tests. Done means local replacements create sorted, deduplicated project references, remote replacements do not, and the stated cases are covered; linked pull request #671 is already open.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Context

The Go scanner in src/core-open/scanners/go-scanner.ts returns one project per go.mod but never sets projectReferences. Maven modules (<modules>) and npm workspaces already get those edges, so the architecture and graph views can show how projects in a monorepo depend on each other. Go monorepos currently look like a set of unrelated modules.

Go has two clear signals for local module links:

  • a go.work file at the root with use ./svc/api / use ( ... ) entries
  • a replace example.com/lib => ../lib directive whose target is a local path (the scanner already detects these and skips the proxy lookup for them)

What to do

  1. For each local-path replace, add a projectReferences entry pointing at the replaced module's directory (relative to the scan root), when that directory is one of the scanned Go projects.
  2. Optionally read a root go.work and, for each use module that a project requires by module path, add the same kind of reference.
  3. Use refType: 'project' (or the closest existing type) and keep the list sorted and de-duplicated.
  4. Add a fixture with two modules linked by a local replace and a go.work.

Acceptance

  • A module with replace example.com/lib => ../lib has a project reference to ../lib
  • Remote replaces do not create references
  • Modules without local links have no projectReferences
  • Tests cover the replace case (and go.work if implemented)
Ngôn ngữ chính
TypeScript
Star
4
Fork
3
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
76

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vibgrate/cli

Tất cả issue của vibgrate/cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.