-
Notifications
You must be signed in to change notification settings - Fork 41
[interop] Update Configuration to allow TS Compiler Configuration and non-exported decl generation #443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[interop] Update Configuration to allow TS Compiler Configuration and non-exported decl generation #443
Conversation
Instead of manually marging objects to form compiler options, TS API requires using built-in functions to properly resolve the config into a compiler options objects, with enums, correct types, etc. Functions implemented were `parseJsonConfigFileContent` and `getParsedCommandLineOfConfigFile`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a small test if possible.
Re: ignoring errors, is there a valid reason to do this? I can see it may be useful to get some output but I'm worried it might result in other failures later in our generation because we assumed the program was well-formed.
There are few, but good, reasons to do this, mainly if we're trying to handle certain TS declarations that conflict with those built into typescript, like ES specs, DOM specs and Apart from builtin TS compiler types, other use-cases shouldn't need to ignore errors. Also: I found this a useful option as |
Gotcha. I suppose since it's opt-in, users know what errors they're trying to work around. It would be nice if we can allow only ignoring those missing symbols errors and leave all the other errors, but I don't know if that's possible. |
Fixes #442
Fixes #432
This PR updates configuration and arguments to better support configuring the TS declaration generator, as well as improve support for practically using the TS declaration generator on actual libraries.
Features
tsconfig.json
: This allows configuration of the TypeScript compiler via the options available in atsconfig.json
fileexport
keyword, or some may handle declaration exporting differently. This allows us to generate Dart declarations for those libraries, without having to modify them and addexport
keywords.