Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

platform-api-docs: `scan` strategy misses ESM-only packages, which ship `.d.ts` rather than `.d.cts`

Đang mở Phù hợp với người mới
#10,472 0 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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu trong packages/platform-api-docs/src/generate.ts, khoảng dòng 393, và kiểm tra glob quét cùng hành vi loại bỏ trùng lặp của nó. Chạy một yarn build mới sau khi khớp cả hai phần mở rộng khai báo; được coi là hoàn tất khi các gói ESM-only được đưa vào mà không có tài liệu trùng lặp khi cả hai phần mở rộng đều tồn tại.

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

Mô tả

platform-api-docs's scan strategy reads published declaration files with this glob (generate.ts):

node_modules/@metamask/*/dist/**/*.d.cts

That only matches CommonJS declaration files. A package published ESM-only emits .d.ts, so it is skipped silently: no warning, it just contributes nothing to the docs.

Current impact: none

Worth stating plainly so this isn't over-prioritised. Measured on main with a fresh yarn build:

  • 654 .d.cts files still match, so the glob is not dead.
  • 112 of 150 @metamask packages with a dist would be missed (they ship only .d.ts).
  • 99 of those are workspace symlinks, already covered by the packages/*/src scan, and since #10085 source is preferred over build output anyway.
  • The remaining 13 are real npm dependencies: abi-utils, action-utils, api-specs, browser-passworder, create-release-branch, eth-json-rpc-infura, eth-sig-util, metamask-eth-abis, nonce-tracker, object-multiplex, scure-bip39, snaps-registry, swappable-obj-proxy.
  • Zero of those 13 contain messenger types, so nothing is missing from the docs today.

Why file it anyway

The monorepo is migrating to ESM-only (#9536 did platform-api-docs itself). As published @metamask packages follow, their declaration files become .d.ts and this glob stops seeing them. The failure mode is a silent omission rather than an error, which is the part that makes it worth fixing before it bites.

Suggested fix

Match both extensions, e.g. **/*.d.cts and **/*.d.ts, keeping them in the same call so the exclusion scoping established in #10085 is preserved. Note that a package shipping both would then be matched twice, so it is worth checking that deduplication resolves that the way we want.

Ngôn ngữ chính
TypeScript
Star
414
Fork
309
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
388

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 MetaMask/core

Tất cả issue của MetaMask/core

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.