flow-runtime icon indicating copy to clipboard operation
flow-runtime copied to clipboard

please publish library with flow types

Open rkuhn opened this issue 7 years ago • 3 comments

This is a:

  • [ ] Bug Report
  • [X] Feature Request
  • [ ] Question
  • [ ] Other

Which concerns:

  • [X] flow-runtime
  • [ ] babel-plugin-flow-runtime
  • [ ] flow-runtime-validators
  • [ ] flow-runtime-mobx
  • [ ] flow-config-parser
  • [ ] The documentation website

What is the current behaviour?

flow-typed install places the following in flow-typed/npm/flow-runtime_vx.x.x.js:

declare module 'flow-runtime' {
  declare module.exports: any;
}

This means that all usage of Type and its methods result in any.


What is the expected behaviour?

Just export .js.flow in the distribution in addition to the .js. I have dabbled a bit with rollup but couldn’t figure out how to make that happen.


Which package versions are you using?

flow-runtime 0.11.1

rkuhn avatar Jun 02 '17 09:06 rkuhn

Please prioritize this. There is little incentive to using pattern matching or refinements when it is effectively untyped from Flow's perspective. Here's a simple workaround until flow gen-flow-files is ready: https://github.com/graphql/graphql-relay-js/pull/155/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R37

jamiehodge avatar Jun 12 '17 15:06 jamiehodge

@jamiehodge this is the top of my list, unfortunately other work commitments are in the way so it's hard to say when it'll happen. I'd gladly accept a PR.

phpnode avatar Jun 12 '17 15:06 phpnode

@phpnode It seems like this won't really be possible until flow-runitme's own flow types are cleaned up... Seems like there are a lot of flow errors right now and CI doesn't do any linting or flow type checking...

sbking avatar Apr 14 '18 19:04 sbking