Skip to content
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

Are TypeScript definitions generated by transpile supposed to include comments from the WIT file? #397

Open
blaine-arcjet opened this issue Mar 7, 2024 · 4 comments

Comments

@blaine-arcjet
Copy link
Contributor

I found #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?

@guybedford
Copy link
Collaborator

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.

@blaine-arcjet
Copy link
Contributor Author

Interesting! I'm not getting any comments but the current stuff isn't open source. Let me create a reproduction.

@sd2k
Copy link

sd2k commented Oct 10, 2024

I think I may just have run into this too, perhaps due to bytecodealliance/cargo-component#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?

@sd2k
Copy link

sd2k commented Oct 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants