Open Chriscbr opened 1 month ago
without needing to write type definitions and extern information by hand
I'm sold!....
Anyway to simplify the integration with packages out there would. be amazing, the requirement for custom externs I thought was always a bit much.... I love this idea tbh.
Use Case
As a user, I'd like a way to generate "bindings" so that I can use any TypeScript library from npm (or a local TypeScript package) in my Wing code without needing to write type definitions and extern information by hand. See https://github.com/winglang/wing/issues/4922 for a similar flavor of issue
Proposed Solution
For example, I might be able to run a command:
and then a
.gen/@aws-sdk/client-dynamodb/
folder would be generated in my current project, with the bindings inside. The bindings would just be ordinary Wing files using "extern" syntax etc. They're generated by reading the .d.ts files.Then I can use the library directly in Wing:
If there's an issue with the bindings that Wing generates, they're all Wing source files, so you can edit them yourself.
Implementation Notes
Some starting constraints to limit the number of ways things can go wrong:
Related in spirit to https://github.com/winglang/wing/issues/4922
Component
Language Design, Compiler
Community Notes