dart-archive / js_facade_gen

Generates package:js Javascript interop facades for arbitrary TypeScript libraries
Apache License 2.0
162 stars 29 forks source link

Unable to generate interop for ts-ebml #92

Open creativecreatorormaybenot opened 4 years ago

creativecreatorormaybenot commented 4 years ago

I am trying to generate an interop for ts-ebml, however, the package fails:

dart_js_facade_gen --destination . --base-path ts-ebml-master\lib ts-ebml-master\lib\index.d.ts ts-ebml-master\lib\cli.d.ts ts-ebml-master\lib\EBML.d.ts ts-ebml-master\lib\EBMLDecoder.d.ts ts-ebml-master\lib\EBMLEncoder.d.ts ts-ebml-master\lib\EBMLReader.d.ts ts-ebml-master\lib\tools.d.ts

I am using the latest master you can find here: https://github.com/legokichi/ts-ebml/tree/master/lib

Errors

There are multiple errors:

Click to expand details ``` Transpiling [ 'ts-ebml-master\\lib\\index.d.ts', 'ts-ebml-master\\lib\\cli.d.ts', 'ts-ebml-master\\lib\\EBML.d.ts', 'ts-ebml-master\\lib\\EBMLDecoder.d.ts', 'ts-ebml-master\\lib\\EBMLEncoder.d.ts', 'ts-ebml-master\\lib\\EBMLReader.d.ts', 'ts-ebml-master\\lib\\tools.d.ts' ] to . ts-ebml-master/lib/index.d.ts:7:1: re-exports must have a module URL (export x from "./y"). ts-ebml-master/lib/index.d.ts:7:10: no type declarations for symbol version ts-ebml-master/lib/index.d.ts:7:45: no type declarations for symbol "ts-ebml-master/lib/tools" ts-ebml-master/lib/index.d.ts:1:1: Could not format because the source could not be parsed: line 6, column 37: Directives must appear before any declarations. ╷ 6 │ @JS() external String get version; export show version, EBMLDecoder, EBMLEncoder, EBMLReader, tools ; │ ^^^^^^ ╵ line 6, column 44: Expected a string literal. ╷ 6 │ @JS() external String get version; export show version, EBMLDecoder, EBMLEncoder, EBMLReader, tools ; │ ^^^^ ╵ ```

I tried to fix some of the stuff, but I have no idea how to fix the version export for example or I do not even know what the error for line 7 is trying to tell me.


Am I using the tool wrong, does the tool lack features, or is the ts-ebml library out-of-date? And how do I go about fixing this if the command is correct?