rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[api-extractor] Items with non-inline `export`s have incorrect canonical references

Open suneettipirneni opened this issue 2 years ago • 1 comments

Summary

Api extractor emits incorrect canonical reference navigation paths for api items that don't have inline exports. Items that have inline exports and items that export items via export { A, B, C } should all have the same canonical reference paths.

Repro steps

Run API extractor on the following declaration file:

class A {
	foo: string;
}

interface B {
	bar: A;
}

export { A, B };

The output api json shows B#bars canonical reference as a local member instead of an exported member:

Expected result:

B#bar's canonical reference is <packageName>!A:class

Actual result:

B#bar's canonical reference is <packageName>!~A:class

Details

After some investigating the issue is most likely caused by some code within DeclarationReferenceGenerator.

Zulip Chat

Standard questions

Question Answer
@microsoft/api-extractor version? 7.28.3
Operating system? macOS
API Extractor scenario? docs (.api.json)
Would you consider contributing a PR? Yes
TypeScript compiler version? 4.7.4
Node.js version (node -v)? 16.13.2

suneettipirneni avatar Jul 06 '22 16:07 suneettipirneni

I wonder if this will be addressed by https://github.com/microsoft/tsdoc/pull/325. @rbuckton?

zelliott avatar Jul 06 '22 18:07 zelliott