segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.38k stars 830 forks source link

Update doc site to handle typescript files #1611

Closed brandongregoryscott closed 1 year ago

brandongregoryscott commented 1 year ago

Overview Resolves #1607

This PR updates the doc site to not crash when parsing *.tsx files (the build would still succeed anyway, but probably not good to leave it like this). There is a filename option in react-docgen that helps it resolve the babel config which resolves the main issue in #1607.

While I was in here, I also cleaned up the types in PropsTable and tested out to see how it parses TS definitions. I think we may need to tweak the config for components down the line since they are composed on top of ui-box - it seems to only parse top-level props as shown below.

Screenshots (if applicable)

export type ButtonProps = PolymorphicBoxProps<'button', ButtonOwnProps> & {
  onClickFoo?: () => void;
};
image

Documentation

netlify[bot] commented 1 year ago

Deploy Preview for evergreen-storybook ready!

Name Link
Latest commit 55753b105eb5954745c92b80923ef6d09a33cd42
Latest deploy log https://app.netlify.com/sites/evergreen-storybook/deploys/63e15b578d3ae70009833d17
Deploy Preview https://deploy-preview-1611--evergreen-storybook.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.