Skip to content

fix(api-extractor): preserve namespace import-equals exports - #6194

Open
Darsh Patel (darshpatel1052) wants to merge 1 commit into
microsoft:mainfrom
darshpatel1052:fix/api-extractor-namespace-import-equals-6193
Open

Darsh Patel (darshpatel1052) wants to merge 1 commit into
microsoft:mainfrom
darshpatel1052:fix/api-extractor-namespace-import-equals-6193

Conversation

@darshpatel1052

Copy link
Copy Markdown

Summary

Fixes #6193.

Preserves the export keyword on export import X = Y aliases inside namespaces, allowing consumers to access those aliases from declaration rollups. Also fixes the missing keyword in API reports.

Details

Extends DtsEmitHelpers.isExportKeywordInNamespaceExportDeclaration to recognize ImportEqualsDeclaration alongside ExportDeclaration. Both output generators already use this helper.

Adds a regression scenario covering direct and nested namespace aliases, generated snapshots, and a consumer compilation check that uses each alias as both a type and a value. Includes a patch changelog entry.

How it was tested

  • Confirmed the consumer regression fails before the fix with missing exported member errors.
  • On final commit e8f354e8bc, ran rush test --only @microsoft/api-extractor --only api-extractor-scenarios --production --parallelism 2: all 89 unit tests and 62 scenarios passed, including consumer compilation.
  • Passed repository formatting and rush change --verify --target-branch upstream/main --no-fetch.

Validation used RUSH_ALLOW_UNSUPPORTED_NODEJS=1 because the installed Node.js 22.23.3 is one patch below the repository’s minimum.

@darshpatel1052

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@ItsChrisHickman

Copy link
Copy Markdown
Contributor

Darsh Patel (@darshpatel1052) - Thanks for looking into this! Our team uses api-extractor and this resolves one of the bugs that we were having to work around!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

[api-extractor] dtsRollup drops export from export import X = Y inside a namespace

2 participants