-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api-extractor] Add support for api report and documentation for multiple entry points #1932
base: main
Are you sure you want to change the base?
Conversation
@octogonz When you have a moment, can you please take a look? Thanks! |
Thanks for following up. This is an exciting contribution! I apologize I haven't been able to review it yet; this has been a busy sprint for me personally, and there's been a significant increase in new contributions for Rush Stack projects this summer. We're having trouble keeping up with it. |
Gentle ping @octogonz |
+1 The project I am currently working on would also benefit from this feature; when there's bandwidth @octogonz 🙂 |
I think my company just encountered a similar need heheh. I will try to get to this soon. |
Hey @Feiyang1. Thanks for putting this together. Does this handle the case where one entrypoint just uses the types exported by another entrypoint, without necessarily re-exporting it? For example: // module A
import { Foo } from './B';
export interface MyInterface {
foo: Foo;
} // module B
export interface Foo {
field: string;
} Assuming A and B are separate entrypoints, notice that A uses a type declared in B without re-exporting it. Is this adequately handled? |
@hiranya911 I believe you will get a warning that |
+1 from me, this is just what I need to make api-extractor viable in our tool chain |
Bump on this PR. Would love to see it merged! |
Implements #1596
More precisely it implements level 1 described in #1596 (comment) by @octogonz
Main changes:
additionalEntryPoints
field to the config fileapi.json
file ifadditionalEntryPoints
is definedadditionalEntryPoints
is definedImportant limitation: Entry points don't share symbols. For example, if package A has 2 entry points,
packageA
andpackageA/internal
, wherepackageA
reexports a symbol frompackageA/internal
:packageA
packageA/internal
In the
api.json
file,internalFunction()
will appear twice as separate entities forpackageA
andpackageA/internal
respectively. As a result, documenter generates 2 files forinternalFunction()
.I spent a few hours trying to make entry points to share symbols, but made little progress. I think it might require large refactoring beyond my knowledge of the codebase.
Though not sharing symbols between entry points is not ideal, it's currently not a deal breaker for me.
Please let me know if the approach doesn't look reasonable. Thanks!