milesj / docusaurus-plugin-typedoc-api

Docusaurus plugin that provides source code API documentation powered by TypeDoc.
71 stars 26 forks source link

Enums with numbers do not render the correct `type` due to `reflection.type` being undefined #45

Closed vladfrangu closed 2 years ago

vladfrangu commented 2 years ago

Hello!

I've recently deployed a website with your plugin, but I've encountered a strange issue with numeric enum members: https://discord-api-types.dev/api/next/discord-api-types-v10/enum/ActivityFlags#Embedded

The source code for the website is visible at https://github.com/discordjs/discord-api-types, in the website folder

For some reason, reflection.type is undefined in this case. Could it be an issue with the JSON I made? Is there an easy fix for this?

Thanks!

milesj commented 2 years ago

@vladfrangu Are you expecting the actual bitwise to be rendered, like 1 << 6?

vladfrangu commented 2 years ago

Well, honestly I'd be fine with either the final number to be rendered, or just the type of the defaultValue. Right now it renders like this, which is less than ideal (that : is out of place)

Google Chrome Dev - 2022-05-25 at 02 30 05@2x
milesj commented 2 years ago

@vladfrangu Recreated this and it looks like the raw JSON data just has the number above.

Screen Shot 2022-05-28 at 5 22 39 PM

I'd report this to TypeDoc. Not much I can do here, especially since there's no other metadata/flags to work with.

vladfrangu commented 2 years ago

Thanks! I'll create a minimum repro sample and report it to them, and keep the patch I have for now to render the defaultValue if missing

vladfrangu commented 2 years ago

🎉 whenever 0.23 is released this will be fixable https://github.com/TypeStrong/typedoc/commit/261b5a1142847adff2afdb8b10b844d6fcba1ed7

milesj commented 2 years ago

Awesome, that was fast.

vladfrangu commented 2 years ago

Actually just noticed this has been released in 0.22.16! I guess this issue can be closed since no release is needed from your side, correct?

vladfrangu commented 2 years ago

Hmm...I tried a clean reinstall of the plugin but it still doesn't seem to render correctly, even if the JSON is correct 🤔

Scratch that, was looking at previous versions!

milesj commented 2 years ago

v2.1 is now on TypeDoc v0.23, which should include this fix!