Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

[api-extractor] Keep separate d.ts files but filter public API

Offen
#5,453 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
node.js, typescript

Rechercherichtung

Start by reviewing API Extractor's reporting, rollups, and docs scenarios, especially dtsRollup, alongside TypeScript's per-module .d.ts output and the package.json exports mapping. Define how modules are crawled, public exports are filtered, and matching output files are generated. Done means separate non-empty .d.ts files preserve the source hierarchy, with discrepancies reported.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Summary

I'd like to use the API extractor functionalities to track my public API and filter anything non-public from my d.ts files.

At the same time I want to keep separate d.ts files (one for every .mjs just like typescript prints it).

Unfortunately the dtsRollup works in a "bundle/barrel module" mindset where you only have a single library file.

Details

In the era of ESM the practice of "bundling" when publishing packages seem to vanish to support features like tree-shaking better. Same applies for "barrel modules" which contain all exports of your library.

Following this strategy it would be great if api-extractor could do it's magic without expecting a single barrel d.ts.

Imagine a tsc output of .mjs and .d.ts files matching the .ts file hierarchy. I'd expect:

  1. api-extractor to crawl the modules of my project and build the public API surface.
  2. Potentially the exports property of the package.json is consulted to filter what's really public from an NPM perspective (mapping might be tricky though).
  3. api-extractor writes the output d.ts files with the same hierarchy to a given output directory (empty d.ts files are omitted).
  4. Any warnings on discrepancies of exports are reported (e.g. a public api exposes a filtered private one).

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? 7.53.3
Operating system? Any
API Extractor scenario? reporting (.api.md) / rollups (.d.ts) / docs (.api.json)
Would you consider contributing a PR? Maybe, depends on the efforts
TypeScript compiler version? 5.9.3
Node.js version (node -v)? v24.11.0
Vorherrschende Sprache
TypeScript
Sterne
6.5k
Forks
708
Ø Merge
4 T. 13 Std.
Gemergte PRs (30 T.)
62

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/rushstack

Alle Issues in microsoft/rushstack

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.