Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#10,472 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
documentation

Direzione di ricerca

Inizia in packages/platform-api-docs/src/generate.ts intorno alla riga 393 e ispeziona il glob di scansione e il relativo comportamento di deduplicazione. Esegui un nuovo yarn build dopo aver fatto corrispondere entrambe le estensioni delle dichiarazioni; è completato quando i pacchetti ESM-only sono inclusi senza documentazione duplicata quando entrambe le estensioni esistono.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
414
Fork
309
Merge medio
1g 4h
PR unite (30g)
388

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MetaMask/core

Tutte le issue di MetaMask/core

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.