Open arnarthor opened 7 years ago
Looks like this is an upstream issue in Flowgen. We have our own Flowgen fork, reasonable-flowgen.
Another instance of what's probably the same issue, while trying to run the parser on https://github.com/firebase/firebase-js-sdk/blob/master/packages/firebase/index.d.ts
Error: Parse_error.Error: undefined
at Object.compile (/Users/murphy/.nvm/versions/node/v8.9.4/lib/node_modules/reasonably-typed/lib/index.js:60:11)
at fs.readFile (/Users/murphy/.nvm/versions/node/v8.9.4/lib/node_modules/reasonably-typed/lib/cli.js:56:40)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
retyped --version
0.13.0
It looks like the dependency on flowgen and even checking if the file is a typescript file was removed in c18c12a60129b5e11daa0f69f3d287fdb97982cb. As it is, it is trying to parse the typescript definitions as flow types. Was this intentional? Should we add back flowgen or reasonable-flowgen, or was there a different approach in mind?
Now that ReasonablyTyped is compiling with BuckleScript, we can start to use JS libraries, specifically the TS parser. Look for ReasonablyTyped-native TS support coming soon :grin:
This means there's some new areas for help, and some new issues I have to create. If anyone is looking for contribution opportunities though, BuckleScript bindings to the TS API would be awesome!
I've been writing a ton of bindings lately. If you can point me at the specific interfaces that are highest priority for you I could start with those.
@zploskey I'm working on bindings to the TS compiler in bindings/typescript.re
. Here's a pretty good example on how to expose an AST node to Reason: https://github.com/rrdelaney/ReasonablyTyped/commit/5046d9d379828a59cf6583aa630f55398bf62d46. I'm using AST Explorer for debugging what nodes have what that are actually useful to ReasonablyTyped.
Are there any simple way to make it works with TypeScript for now? I have tried to contribute but I have no idea which part to start. Ideally, I want to focus on make it works with TypeScript because it seems like there are lots of TypeScript lib compared to flow.
@digitake check out the 2 directory in the root of the project 🙂 that’s the future of the project, and it should be more clear what’s going on in it.
Description
Tried running retyped compile for raven-js typescript definitions resulting in the following error.
Step to reproduce
yarn add -E raven-js@3.17.0
retyped compile node_modules/raven-js/typescript/raven.d.ts
Setup details
retyped --version 0.11.0 bsc -version BuckleScript 1.9.1 (Using OCaml4.02.3+BS )
If you need more details you can ping me on Discord (@arnar) or this issue đź‘Ť