[api-extractor] Keep separate d.ts files but filter public API
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- node.js, typescript
- Área
- build-system, tooling
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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:
- api-extractor to crawl the modules of my project and build the public API surface.
- Potentially the
exportsproperty of the package.json is consulted to filter what's really public from an NPM perspective (mapping might be tricky though). - api-extractor writes the output
d.tsfiles with the same hierarchy to a given output directory (empty d.ts files are omitted). - 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 |
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.5k
- Forks
- 708
- Merge medio
- 4 d 13 h
- PR fusionados (30 d)
- 62
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/rushstack
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/rushstack#5971 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
microsoft/rushstack#5902 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/rushstack#5839 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
microsoft/rushstack#5683 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/rushstack
Issues similares
-
ADD openalgoAbiertotemplate
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
vercel/ai#21528 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
microsoft/fluentui-contrib#671 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
sveltejs/acorn-typescript#150 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100