Open rhoskal opened 6 years ago
Do you have many javascript files that don't use Flow? (Do you think it might be common to have many non-Flow .js files in projects using flow-copy-source?) This feature wouldn't be too hard to implement, but I'm not sure I want to add the performance or conceptual overhead for what might be a rare case.
Probably not if you are starting a project from scratch. However, I could definitely see how this "enhancement" would be beneficial if you are transitioning legacy code--especially on a large code base. You definitely don't have to commit the work since both of we both have working solutions to solve each of our point of views. Just my 2 cents.
@hansjhoffman you can try to use https://github.com/ilyalesik/gen-flow-files
I came across this on my journey learning how to export my own npm module's flow types. While this module does save a lot of "hand jamming", it also copies EVERY .{js,mjs,jsx} even if they don't have the Flow Type annotation comment (e.g.
// @flow
or `/ @flow */`) thus "bloating" the lib/ or dist/ folders. The most simplistic and elegant approach I came up with was to use a simple one-liner script in my package.jsonThis would be a nice feature to add to your module, however I'm not sure kefir read contents of files like grep can. This way we follow the philosophy of keeping modules as lean as possible.