[Add] Docgen auto generation of docs scripts#3136
Merged
flyingcircle merged 10 commits intoJul 15, 2021
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## next #3136 +/- ##
=======================================
Coverage 83.85% 83.85%
=======================================
Files 78 78
Lines 1685 1685
Branches 664 664
=======================================
Hits 1413 1413
Misses 268 268
Partials 4 4
Continue to review full report at Codecov.
|
khushal87
marked this pull request as ready for review
July 11, 2021 09:48
| }); | ||
|
|
||
| CardDivider.displayName = 'CardDivider'; | ||
| CardDivider.displayName = 'Card.Divider'; |
Member
Author
There was a problem hiding this comment.
The name should be the same as the use-case, therefore I have changed it. As users are going to use it as Card.Divider. Also, this will help detect the parent directory by splitting using the '.'. The first part would be the Base component dir and the 2nd part will be the children.
khushal87
marked this pull request as draft
July 14, 2021 11:53
khushal87
marked this pull request as ready for review
July 14, 2021 12:13
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.
What kind of change does this PR introduce?
This PR introduces adding scripts to generate docs automatically. It uses
react-docgen-typescriptto achieve the same.Did you add tests for your changes?
No.
React docgen Typescript, for now, has its own tests and we can rely on them as they are stable. We can add tests to our code in the future. I plan to add them if needed in the future with a single PR.If relevant, did you update the documentation?
Will be done later with a single PR.
Summary
To run the scripts for now and generate the documentation run the command:
This will trigger
scripts/docgen/index.tsxscript. It calls the functiongetAndStoreComponentDocswhich callsgetComponentFileswhich is a utility to get all the file paths of the components in the form of an array. This is served as input to thegenerateComponentDocswhich generate the component docs usingreact-docgen-typescript. The result is stored inside the.docgendirectory in the respective folders.The scripts have the respective files:
componentMap.tsto a single array of files having all the component file paths.Does this PR introduce a breaking change?
No.
Other information
Disclaimer: These are the initial scripts to generate JSON just to make sure that the data is received for every prop type and descriptions are fetched. There will be changes in future PRs once the Markdown is generated.
Tags
#gsoc #docs-autogen #khushal87