[api-extractor] Export aliases lost with `bundledPackages`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- nodejs, typescript
- Área
- developer-experience, tooling
Línea de trabajo
Start with the linked bundledPackages-reexport-aliased reproduction and run the documented yarn install and build commands. Compare package-b/api-reports/package-b.api.md and package-b/dist/package-b-public.d.ts with package-a/src/FooInternal.ts and package-a/src/index.ts, then trace bundledPackages alias resolution. Done means Baz uses FooExternal and the ae-forgotten-export warning is absent in both outputs.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[api-extractor] bundledPackages uses a source declaration name instead of its exported alias
Summary
When an aliased API export from a package listed in bundledPackages is referenced, API Extractor uses the original source declaration name when referencing that API from the consuming package. The original name is not part of the dependency's public API, so the generated API model and report contain an incorrect reference and an ae-forgotten-export warning. The incorrect name is also used in the generated declaration rollup.
Repro steps
The minimal reproduction is available at:
https://github.com/Josmithr/api-extractor-playground/tree/bundledPackages-reexport-aliased
-
Clone the reproduction branch.
-
From the repository root, install dependencies and build
package-bwith its dependency:yarn install --frozen-lockfile yarn lerna run build --scope package-b --include-dependencies -
Inspect
packages/package-b/api-reports/package-b.api.mdandpackages/package-b/dist/package-b-public.d.ts.
In package-a, FooInternal is exported from the package entry point as FooExternal:
// package-a/src/FooInternal.ts
export type FooInternal = string;
// package-a/src/index.ts
export { FooInternal as FooExternal } from './FooInternal.js';
package-b lists package-a in bundledPackages and references the public name FooExternal:
import type { FooExternal } from 'package-a';
/** @public */
export type Baz = FooExternal;
Expected result:
The API report should preserve the name exported by package-a:
export type Baz = FooExternal;
Actual result:
The API report uses the private source declaration name and reports it as a forgotten export:
// Warning: (ae-forgotten-export) The symbol "FooInternal" needs to be exported by the entry point index.d.ts
//
// @public
export type Baz = FooInternal;
The public declaration rollup similarly contains:
export declare type Baz = FooInternal;
declare type FooInternal = string;
Details
This appears to occur while API Extractor follows the FooExternal re-export into the bundled package. It resolves the underlying declaration correctly, but uses that declaration's local name (FooInternal) instead of the name exported from the dependency's entry point (FooExternal) when generating references in package-b.
Explicitly re-exporting FooExternal from package-b avoids the issue:
export type { FooExternal } from 'package-a';
export type { Baz } from './Baz.js';
With this re-export, the API report and declaration rollup both use FooExternal, and the ae-forgotten-export warning disappears. This suggests the incorrect name is used specifically when the bundled API is referenced by an exported declaration but is not itself exported from the consumer's entry point.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
| Question | Answer |
|---|---|
@microsoft/api-extractor version? |
7.58.12 |
| Operating system? | Linux x64 (Ubuntu 24.04) |
| API Extractor scenario? | Reporting (.api.md) and rollups (.d.ts) |
| Would you consider contributing a PR? | Possibly, with maintainer guidance |
| TypeScript compiler version? | 5.9.3 |
Node.js version (node -v)? |
v24.14.0 |
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.5k
- Forks
- 708
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 46
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
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
MystenLabs/MemWal#1085 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
📕documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
db-ux-design-system/core-web#8343 ·
Los mantenedores suelen responder en 1 día
-
enhancement triage/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
heygen-com/hyperframes#4944 ·
Los mantenedores suelen responder en 1 día
-
Pressing Escape to close the time dropdown in the event form asks to discard the whole eventAbiertoai-driven-qa bug claude
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
linagora/twake-calendar-frontend#1493 · 1 comentario ·
Los mantenedores suelen responder en 1 día