jco
jco copied to clipboard
Are TypeScript definitions generated by transpile supposed to include comments from the WIT file?
I found https://github.com/bytecodealliance/jco/pull/94 which fixed the TypeScript generation and it mentions comments, but I can't seem to get the comments I defined in my .wit
file to actually show up when I use jco transpile
. Is this something that is supported?
Yes TypeScript output includes the comments from WIT. If you have an example of what specific doc comments are being missed in translation that would be great to track.
Interesting! I'm not getting any comments but the current stuff isn't open source. Let me create a reproduction.
I think I may just have run into this too, perhaps due to https://github.com/bytecodealliance/cargo-component/issues/229? Is there any way of pointing transpile
to the original WIT file to get the comments back, since they're not included in the WASM right now?
Huh, well I found a workaround: after running jco transpile
I can run jco types
and point it at the original WIT file to get the types with doc comments. For anyone finding this, if you have imports you'll need to add the corresponding WIT files to a deps
directory next to the main WIT file, too.