Hello! I’m looking at the docs for “using js code from kotlin” and was wondering if there was ways to forgo the manual declaration of external dependencies (npm packages) and instead generate these from typescript definitions?
e
Edoardo Luppi
12/06/2024, 11:31 AM
A fully automated way isn't available unfortunately.
You can try with Dukat (although it might break with new TS versions), or Karakum (which is difficult to set up in most cases).
I landed on a mix of Karakum + manual adjustments. The first generation will be costly in terms of spent time tho.
same 1
Edoardo Luppi
12/06/2024, 11:33 AM
Also remember that most of the times you don't need a full copy of the externals, but just selected APIs. I'd start with what you really need first.
r
Reuben Firmin
12/06/2024, 12:55 PM
Also Claude is pretty good at producing these. May need a little tweaking, but a good way to automate 90%
🔝 1
e
Edoardo Luppi
12/06/2024, 12:56 PM
The problem is always splitting the output up into multiple files.
But might be that it's me, I don't like having a gigantic single file for all externals.
a
Alex
12/06/2024, 3:52 PM
Awesome, thanks all! really nice to hear. I’ll likely just take the route of only defining partial/needed external functionality.