joarwilk / flowgen

Generate flowtype definition files from TypeScript
Other
658 stars 78 forks source link

Status of the project? #29

Closed stereobooster closed 6 years ago

stereobooster commented 6 years ago

First of all this project is getting less attention than it suppose.

Even if it is not able to convert all definitions 100% reliably it can serve as a starting point. This tool should be part of flow-typed. If flow-typed can not find original flow definitions it can search DefinetlyTyped for definition, download it and convert to flow with flowgen. If there is no DefinetlyTyped definitions it can generate stubs.

Other questions is how to improve and verify quality of generated code.

There is flow-to-typescript. We can convert from ts to flow and then from flow to ts and compare results. If they are identical it means, that you are lucky one you have definition without ambiguation.

There is type-profile, which can gather runtime type information, which can be used to verify type signatures. For example, we can run tests, gather info about types and compare to what we have. Idea not new, there are similar project for Python - MonkeyType, for Ruby - ruby-type-inference.

There is babel-plugin-transform-flow-to-gen. We can use type signatures to generate property based tests (like QuickCheck in Haskell) and run those.

There is flow definition linting tool.

Related https://github.com/stereobooster/type-o-rama, https://github.com/flowtype/flow-typed/issues/1494

joarwilk commented 6 years ago

Yeah I have absolutely zero time right now to maintain this, unfortunately. Especially since I've personally stopped using Flow for the time being.

It needs to be perfect to prevent confusion for users in order to be included in flow-typed. And as much as I would like to improve the parser, I dont see it happening for the forseeable future.

stereobooster commented 6 years ago

Thank you for letting know. This project is helpful anyway 👍

saadq commented 6 years ago

Thanks for the work you put into this up til now @joarwilk .

If you don't mind me asking, when you say:

Especially since I've personally stopped using Flow for the time being.

Did you switch to TypeScript or did you just stop using a type system?

joarwilk commented 6 years ago

Did you switch to TypeScript or did you just stop using a type system?

@saadq I stopped using type systems because they were too easy to cheat, especially Flow. I felt a false sense of security using it and decided it was better to rely on good tests instead.

orta commented 6 years ago

FWIW, I use this with Danger JS, and I'm happy to help with maintain this repo

sibelius commented 6 years ago

@joarwilk could u add @orta as a maintainer? I think this could be very useful for the community

maybe transfer to him if u don't want to maintain this anymore

joarwilk commented 6 years ago

@sibelius I added @orta as a collaborator. Any help is appreciated!

orta commented 6 years ago

❤️

orta commented 6 years ago

@joarwilk if you'd like I can also handle releases, in which case you'd need to add @orta to the module

orta commented 6 years ago

Poke @joarwilk about being added to the collaborators on npm so I can make releases <3

joarwilk commented 6 years ago

@orta Added you as maintainer, sorry for the delay 🙂

orta commented 6 years ago

Thanks @joarwilk

Alright, I'm closing this issue - the state of this project is now "works in production, will accept new PRs with tests." If people are interested in continuing to try port definitely typed to Flow that's 👍 with what I think this repo can/should do.

My plan will be to ensure that it can grow, and not break my non-trivial DTS -> Flow setup on danger-js.