-
Notifications
You must be signed in to change notification settings - Fork 52
Apply react-docgen-typescript-plugin to generate storybook documentations from JSDoc #931
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
Apply react-docgen-typescript-plugin to generate storybook documentations from JSDoc #931
Conversation
|
|
GitHub registry에 배포된 npm registry에 해당 패키지를 public으로 배포할지 체크 필요함 (bezier-react는 public package이기 때문에 organization-scope 접근 권한을 강제할 수 없음) |
Chromatic Report🚀 Congratulations! Your build was successful! |
Codecov ReportBase: 71.08% // Head: 71.20% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## next-v1 #931 +/- ##
===========================================
+ Coverage 71.08% 71.20% +0.12%
===========================================
Files 208 208
Lines 2967 2980 +13
Branches 823 823
===========================================
+ Hits 2109 2122 +13
Misses 739 739
Partials 119 119
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
| import type { InjectedInterpolation } from './Foundation' | ||
|
|
||
| /* Component Base Props */ | ||
| export interface RenderConfigProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
… to production storybook
… expand enum values
this package is public to anonymous user
9dee6f1 to
5e760f7
Compare
…de (#2616) <!-- How to write a good PR title: - Follow [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ## Self Checklist - [x] I wrote a PR title in **English** and added an appropriate **label** to the PR. - [x] I wrote the commit message in **English** and to follow [**the Conventional Commits specification**](https://www.conventionalcommits.org/en/v1.0.0/). - [x] I [added the **changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) about the changes that needed to be released. (or didn't have to) - [x] I wrote or updated **documentation** related to the changes. (or didn't have to) - [x] I wrote or updated **tests** related to the changes. (or didn't have to) - [x] I tested the changes in various browsers. (or didn't have to) - Windows: Chrome, Edge, (Optional) Firefox - macOS: Chrome, Edge, Safari, (Optional) Firefox ## Related Issue <!-- Please link to issue if one exists --> <!-- Fixes #0000 --> close web-7689 ## Summary <!-- Please brief explanation of the changes made --> Enable JSDoc-based argument controls in development mode ## Details <!-- Please elaborate description of the changes --> This PR removes the production-only restriction for the react-docgen-typescript-plugin that generates Storybook documentation from JSDoc comments. As tested, enabling this feature in development mode doesn't seem to cause significant performance issues that were initially concerns. This change will provide a consistent documentation experience across both development and production environments. Related to PR #931 which originally introduced the JSDoc-based documentation generation but limited it to production builds due to performance concerns. ### Breaking change? (Yes/No) - No <!-- If Yes, please describe the impact and migration path for users --> ## References <!-- Please list any other resources or points the reviewer should be aware of -->
Self Checklist
Related IssueSummary
react-docgen-typescript-plugin을 적용하여, 스토리북에서 JSDoc에 의해 generate된 documentation을 확인할 수 있도록 합니다.Props interface의 각 필드에 추가된 jsdoc, default value등을 확인할 수 있습니다.
Documentation을 MDX 문서에 추가해, API section이 자동적으로 관리되도록 지정했습니다.
Details
원래
react-docgen-typescript-plugin은 typescript를 사용하고 있다면 storybook에서 out-of-the-box로 바로 적용되어야 합니다. (#)그러나, 복합적인 이슈 때문에 이것이 작동하지 않고 있었는데, 이 점을 차례대로 고쳤습니다.
기본적으로 적용되는 plugin은
react-docgen-typescript-plugin은react-docgen-typescriptv1을 사용합니다. 그러나, 이 package는 v1에서typescript < 4.3에서만 작동합니다.typescript >= 4.3에서 작동하기 위해서는 v2를 사용해야 하는데, 이것은 breaking change이기 때문에 storybook v6에서는 적용되지 않았습니다.react-docgen-typescript-plugin을 fork하여react-docgen-typescriptv2를 사용하도록 합니다.react-docgen-typescript-plugin은 default export되는 컴포넌트에 잘 적용되지 않는 이슈가 있습니다.react-docgen-typescript-plugin은 HMR 환경에서 많은 메모리를 소비합니다. (OOM 에러를 자주 발생시킵니다.)Breaking change or not (Yes/No)
No
References