Generate Winglang bindings for TypeScript packages #7158
Labels
⌨️ cli
CLI
🛠️ compiler
Compiler
✨ enhancement
New feature or request
📐 language-design
Language architecture
needs-discussion
Further discussion is needed prior to impl
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 #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 #4922
Component
Language Design, Compiler
Community Notes
The text was updated successfully, but these errors were encountered: