-
-
Notifications
You must be signed in to change notification settings - Fork 202
chore: install and configure TypeScript #287
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
const Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(function Anchor( |
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.
We need to replace React.forwardRef
with forwardRef
, otherwise props are not correctly captured by react-docgen-typescript
.
}; | ||
|
||
export default Anchor; | ||
export { Anchor, AnchorProps }; |
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.
Storybook recommends not exporting the component as default:
If you run into an issue where any additional props don't show up, check your component's code. If you're using a default export, change it to a named export, and doing that will ensure that the additional props are included.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 754b321:
|
@arturbien @luizbaldi I paused work on this to get some feedback from y'all:
|
@@ -13,6 +13,11 @@ import { | |||
WindowContent | |||
} from 'react95'; | |||
|
|||
const Wrapper = styled.div` |
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.
Please remove these type of changes from this PR (moving Wrapper in stories to the top etc)
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.
Some components have Wrapper defined above the export already.
This was done to fix no-use-before-define errors, would you want to disable those rules?
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.
oh ok, I didn't notice we enforced this rule. If that's the case let's keep the changes!
@WesSouza I've noticed that prop type table is not generated for anchor component: |
@arturbien I tested adding more props and those appear, but not children. I wonder if that's expected from that addon. |
@WesSouza let's try to collapse the commits to a fewer ones where possible and change the last commit type to |
aa7a331
to
d20ebfc
Compare
This commit: - Adds .editorconfig file - Installs TypeScript and necessary dependencies - Configures TypeScript tsconfig.json - Configures Rollup to use esbuild and export .d.ts - Converts entry files to TypeScript - Configures Storybook to generate docs based on types - Configures TypeScript on ESLint - Configures Jest and ts-jest for TypeScript - Fixes no-use-before-define problems on stories - Ignores @typescript-eslint/no-unused-vars on mapFromWindowsTheme - Fixes test failure on CSS check
🎉 This PR is included in version 3.13.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR installs and configures TypeScript across our use cases.
This:
esbuild
and `rollup-plugin-dtsts-jest
Anchor
to TypeScriptSo far this is an incremental approach that allows JS and TS files to coexist.
I haven't checked if the output of
esbuild
is equivalent to the priorbabel
usage. I also haven't checked if we can remove babel from our explicit dependencies.