storybookjs / react-native

📓 Storybook for React Native!
https://storybook.js.org
MIT License
1.08k stars 156 forks source link

migrate withStorybook to typescript #633

Closed tlow92 closed 4 weeks ago

tlow92 commented 4 weeks ago

Proposal to fix https://github.com/storybookjs/react-native/issues/630

[!NOTE] Instead of manually defining the d.ts file I converted the current implementation to typescript and let tsup emit the .js and .d.ts file. This should hopefully be more future-proof.

In general it works, but I had to add a custom tsup cli cmd to the package.json (reason is explained below).

dannyhw commented 4 weeks ago

thanks for getting this underway! I think we got a good solution here. I'm going to merge and start working toward a 8.4 pre-release with multiple changes in it

trajano commented 2 weeks ago

I looked at the code the hack I did with export = withStorybook is not needed if you converted to typescript instead just export function withStorybook in an earlier line.

The hack was needed because of the d.ts nature which no longer applies.