microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.9k stars 595 forks source link

[api-extractor] declaration rollup result is empty when having `export = something` #3998

Open guoyunhe opened 1 year ago

guoyunhe commented 1 year ago

Summary

In some old commonjs project, we use export = something syntax.

tsc generates normal *.d.ts declarations. However, when rollup declaration with API Extractor, the result is empty:

export {}

Repro steps

Expected result:

Actual result:

Details

Standard questions

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

Question Answer
@microsoft/api-extractor version?
Operating system?
API Extractor scenario?
Would you consider contributing a PR?
TypeScript compiler version?
Node.js version (node -v)?
octogonz commented 1 year ago

Could you just update your source file to use non-deprecated syntax? It is usually a pretty easy change.

guoyunhe commented 1 year ago

Could you just update your source file to use non-deprecated syntax? It is usually a pretty easy change.

Changing export = something to export default something or export { something } is a breaking change. Unluckily, I cannot do this at this moment. In next major version I will switch to export { something }.