-
Notifications
You must be signed in to change notification settings - Fork 628
🚧 Derive component docs.json from TS #6641
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
base: main
Are you sure you want to change the base?
Conversation
|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
1ead879
to
4f6da94
Compare
This change builds upon some of the foundations from #6047 to enable us to progressively move towards more colocated documentation for our prop types inline with the TS source-code.
As a first-step, the list of properties to expose to documentation will still remain in the
*.docs.json
file, but each now have the option of using the"derive": true
flag to gather any pertinent information from the TS types, includingdescription
(JSDoc),defaultValue
,type
, andrequired
. Fields specified in the*.docs.json
will override any from TS, allowing for customization as more is moved into each component.This reduces the amount of overhead for maintaining the separate
*.docs.json
per Component and also has the added benefit of exposing better documentation for users within their IDEs (which already pull from JSDoc comments and tags like@default
)Validation & AutoFixing
Included in the
doc-gen
package is the ability to validate that the exports for a component in TS match what is present in thedocs.json
file:This will highlight differences in what we're exposing to our users from documentation & in their IDE.
Running with

-v
will present a detailed breakdown of what each source exports:And running with the
--fix
flag will write all data from thedocs.json
back into the TS type in order to align themSample report generation
Component Documentation Status
Detailed Component Summary