-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Include flow definitions in npm package #359
Comments
Agreed that this would be great. I'll investigate the current best practice that would avoid us having to maintain a separate type definitions file and export these correctly. |
I have managed to locally make it work, just by copying every JS source file, alongside it's respective output JS file as .js.flow |
@alexanderchr @JohnyDays I made a solution (flow-dynamic ) for this . See pr:89 i push to |
Update: we're going to make this work! Here's the plan: The Flow team is supportive of the idea of introducing flow types directly in npm packages. Right now the suggestion is to use the same approach @JohnyDays and @nodkz suggested in #412, however as I understand it in the future they hope to include a tool alongside flow which produces higher quality exported flow types. My primary concern is safely introducing flow types errors for people who are using graphql-js and flow, but have not yet had an opportunity to check for flow errors. I also would like an opportunity to create a window of time for interested people to contribute feedback about the quality of the flow types before introducing them for all. Here's the upcoming release plan: v0.7.0: Introduce all latest improvements and changes to graphql-js, but no flow-types. |
Awesome! Looking forward to ditching my ad-hoc solution. Cheers |
Some exciting news on this front! v0.7.0 was released a couple weeks ago, and after flow v0.34, the graphql-js codebase should be correctly typed again, so I'm looking into releasing a pre-release for people to test. |
If somebody wants to test
PS. Yarn does not work with this link ((( |
@leebyron: Do we need to do some additional configuration to include the I don't know how the Travis-mediated publishing works, but I can see we're doing some manual transforming and copying in resources/prepublish.sh and resource/npm-git.sh. I am not sure where |
You're right @wincent something went wrong with the npm deploy and the flow files went missing. I'm looking into it :/ |
Hey @wincent I just published 0.8.0-beta3 which made sure the flow files were in there. Let me know what you learn |
@nodkz at any point you can also depend directly on git! https://github.com/graphql/graphql-js#want-to-ride-the-bleeding-edge |
Closing this issue since this is out in beta now - please provide feedback! |
I'll update my projects and check it out. Thanks @leebyron |
I'm currently using a cloned repo to get flow typings but it would be really nice if these were included in the npm package.
The downside is of course that you'd have two copies of the code. Another option would be to provide untranspiled code as a separate package. How do other libs with flow definitions handle this?
The text was updated successfully, but these errors were encountered: