rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[api-extractor] Re-exported namespace members not included in the report

Open hiranya911 opened this issue 4 years ago • 3 comments

Is this a feature or a bug?

  • [ ] Feature
  • [X] Bug

Please describe the actual behavior.

Consider the following entrypoint implementation:

import * as _auth from './auth/auth';

export namespace auth {
    export import Auth = _auth.Auth;
    export import UserRecord = _auth.UserRecord;
}

Note that the auth namespace re-exports several types from another module. I expect definitions of Auth and UserRecord to be included in the generated API report. But this is all I get:


// @public (undocumented)
export namespace auth {
    import Auth = _auth.Auth;
    import UserRecord = _auth.UserRecord;
}


// (No @packageDocumentation comment for this package)

If this is a bug, please provide the tool version, Node.js version, and OS.

  • Tool: API Extractor
  • Tool Version: v7.9.11
  • Node Version: v10.22.0
  • OS: Mac OS

hiranya911 avatar Aug 27 '20 20:08 hiranya911

Seeing the same problem with symbol re-exports from inside a namespace.

Input:

import { credential } from './credential';

export namespace admin {
  export { credential }
}

Generated report:


// @public (undocumented)
export namespace admin {
  { credential }
}


// (No @packageDocumentation comment for this package)

hiranya911 avatar Sep 12 '20 00:09 hiranya911

Hi, is this a known limitation, not considered best practice?

hmm I guess one can omit the export namespace and just declare it?

pedroteixeira avatar Mar 14 '22 21:03 pedroteixeira

`

Hi, is this a known limitation, not considered best practice?

hmm I guess one can omit the export namespace and just declare it?

api-exporter would then omit un-exported namespaces from the final API report / d.ts bundle

maximzavadskiy avatar Apr 15 '24 13:04 maximzavadskiy