Enhancement: resolve pnpm `catalog:` dependencies from `pnpm-workspace.yaml`

Đang mở
#664 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 13/11/2026.

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
68/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript, yaml
Lĩnh vực
backend, cli, databases

Hướng nghiên cứu

Start with src/core-open/scanners/npm-cache.ts and src/core-open/scanners/node-scanner.ts, then trace how the scanner detects the root pnpm-workspace.yaml and looks up lockfile versions. Check the existing scanner tests and add cases for default, named, and missing catalog entries. Done means catalog ranges are used for drift and lockfile lookup, the written spec remains currentSpec, and missing entries still produce rows.

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

Mô tả

enhancement

Context

pnpm catalogs let a monorepo keep shared versions in pnpm-workspace.yaml:

catalog:
  react: ^18.3.1
catalogs:
  legacy:
    react: ^17.0.2

and refer to them from each package.json as "react": "catalog:" or "react": "catalog:legacy".

isSemverSpec in src/core-open/scanners/npm-cache.ts (around line 281) rejects catalog: because it is not a semver range, and scanOnePackageJson in src/core-open/scanners/node-scanner.ts (around line 349) then skips the dependency. In a monorepo that has moved to catalogs, most dependencies vanish from vg scan.

What to do

  1. Read catalog and catalogs from the root pnpm-workspace.yaml once per scan (the scanner already checks that file exists for package-manager detection).
  2. When a spec is catalog: or catalog:default, use the default catalog entry; for catalog:<name>, use that named catalog.
  3. Use the resolved range for drift and lockfile lookup, and keep currentSpec as written.
  4. If the entry is missing, keep the row visible with an unknown version rather than dropping it.

Acceptance

  • "react": "catalog:" resolves through the default catalog
  • "react": "catalog:legacy" resolves through the named catalog
  • A missing catalog entry still produces a row
  • Tests cover both catalog forms and a missing entry
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.