-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
chore: add & fix type definitions for gatsby, gatsby-link, gatsby-source-fs #13619
Conversation
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.
This is amazing! 😍😍😍
There have been some api changes. I added a bunch of comments for these things. You're great at typescript so I leave it to you to fix these properly 😛 as you'll do a much better job than me 😄
I also asked a few quetions so feel free to ignore those.
I also wonder if we should expose all interfaces, I would suggest only exporting our public API. Which means, not exporting Store, Cache, ...
Perfect, I did this to learn the Gatsby API - so I'll make all those tweaks. Re: exported interfaces, it can depend a bit - if plugins or other functions end up exposing some of these interfaces then we'll have to include them. I'm definitely not in a position to know which is/isn't eventually exposed. So I'm happy to remove thing you recommend. |
Co-Authored-By: orta <[email protected]>
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.
Alright, that's your changes added and amended - 👍
CI seems to be failing due to yarn-y issues, which shouldn't be related from the looks of things?
Would be cool to also add gatsby/packages/gatsby/src/redux/actions.js Line 1335 in dcf6be8
|
thanks, @stefanprobst I added both APIs. @orta mind going over the 3 commits I made and fix them if I made some mistakes (I ran prettier on the last one so you should be able to ignore it unless we need to add some different configs). If so I can merge this one! 🎉 if anything is missing we can iterate on this one in a follow-up PR. |
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.
Yep, the commits look good - and I ran it in my project with no errors 👍
nice work
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.
thank you @orta for cleaning up these types! If you have the time it would be great to add tslint support for our definitions to make sure they are actually valid.
💪 💪
|
…rce-fs (gatsbyjs#13619) Improves the TypeScript type definitions to Gatsby, and also annotates them so that you get inline documentation + API references. Not complete, but a great start.
Description
Improves the TypeScript type definitions to Gatsby, and also annotates them so that you get inline documentation + API references. Not complete, but a great start. Builds off the work by @JamesMessinger in #10897
config
gatsby-node
and
![Screen Shot 2019-04-24 at 10 10 09 PM](https://user-images.githubusercontent.com/49038/56705136-bc08a700-66dd-11e9-811b-f333704474f7.png)
Link