fix(type-gen): improve ownership#176
Open
avivkeller wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves TypeDoc “structural type” (interface/type alias) placement by co-locating root structural types under a single owning class/namespace when they’re uniquely referenced, instead of always generating separate synthetic “types” pages. It also simplifies the <internal> module merge step during conversion.
Changes:
- Add ownership inference (
soleOwnerPages) to detect when a root structural type is referenced by exactly one class/namespace and attach it to that owner page. - Update synthetic type-page generation to split moved structural types between owner pages (when uniquely owned) and synthetic category type pages (fallback).
- Remove
<internal>child filtering logic during project merge.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugins/processor/synthetic.mjs | Uses ownership inference to attach some root types to owning pages; keeps synthetic type pages for remaining types. |
| plugins/processor/ownership.mjs | New ownership analysis for “sole owner” class/namespace detection based on type references. |
| plugins/processor/index.mjs | Removes <internal> child filtering prior to merging reflections into the project. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+93
to
94
| * Move root interfaces and type aliases onto the page that owns them so they | ||
| * remain linkable without appearing as root API exports. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an additional clause to determining a type's owner, "if I am only used by a single namespace, that namespace is my owner"