Skip to content
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

Expose Flow Types #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Expose Flow Types #7

wants to merge 3 commits into from

Conversation

iddan
Copy link

@iddan iddan commented Aug 5, 2018

Resolves #6

@@ -8,6 +8,9 @@ node_modules
build
dist

# flow
!dist/index.js.flow
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem quite right. I don't think anything in the "dist" folder should be committed to Git. Too likely to be stale.

@@ -33,7 +33,7 @@
],
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"files": ["dist"],
"files": ["src", "dist"],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would bloat the size of every NPM install, and not provide any value other than exposing the types.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not completely happy with this either but this is the "supported" solution currently. I think exposing types is a big value for users though.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that publishing types might add value for users, but I don't personally think it's worth it to publish the whole source in this way.

@@ -0,0 +1,2 @@
// @flow
export * from '../src/index.js'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about instead of this, the build script explicitly gather the flow types and save them in dist/index.js.flow so they're automatically included with the NPM bundle?

Copy link
Author

@iddan iddan Aug 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking for such solution for my libraries but couldn't find one. Flow gen-flow-files, the official solution for it, is completely broken (facebook/flow#5871). Maybe there is something to do from within Facebook?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's unfortunate ☹️ I'm not aware of anything internal.

@bvaughn
Copy link
Owner

bvaughn commented Aug 11, 2018

This nags me. I've reached out on Twitter to see if anyone has better ideas.

@bvaughn bvaughn added the help wanted Extra attention is needed label Aug 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants