stencil
stencil copied to clipboard
bug: markdown docs not displaying types as expected
Prerequisites
- [X] I have read the Contributing Guidelines.
- [X] I agree to follow the Code of Conduct.
- [X] I have searched for existing issues that already report this problem, without success.
Stencil Version
2.13.0
Current Behavior
When using custom types in a component prop like this:
export const UTIL_BUTTON_VARIANT_LIST = ['primary', 'secondary', 'important'];
export type UTIL_BUTTON_VARIANT_LIST_TYPE = typeof UTIL_SPACING_TYPE_LIST[number];
/**
* Style variation of the button.
*/
@Prop() variant: UTIL_BUTTON_VARIANT_LIST_TYPE = UTIL_BUTTON_VARIANT_LIST[0];
the generated readme file show always the type string:
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
href |
href |
The button href | string |
'#' |
iconDirection |
icon-direction |
The icon direction of the button | "left" | "right" |
'right' |
iconName |
icon-name |
Icon name | string |
'' |
size |
size |
The size of the button | string |
UTIL_SPACING_TYPE_LIST[1] |
variant |
variant |
Style variation of the button. | string |
UTIL_BUTTON_VARIANT_LIST[0] |
Expected Behavior
The readme should show the correct type, as well as the default value. The previous example should be:
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
variant |
variant |
Style variation of the button. | UTIL_BUTTON_VARIANT_LIST_TYPE |
'primary' |
Steps to Reproduce
Use the previous code show in the Current Behavior section
Code Reproduction URL
https://github.com/not-neccesary
Additional Information
No response
Hey @aresrioja10 👋
Thanks for the detailed info! Can you please create a reproduction case for the team to pull down and inspect? Thanks!
Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.
Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.
For a guide on how to create a good reproduction, see our Contributing Guide.
@rwaskiewicz Let me know if you have access:
https://gitlab.com/david.porres.dev/stencil-types-issue
Looks like I do. Thanks!
I'm going to label this to get it ingested into the backlog for the team to refine further. Thanks!
Thanks @rwaskiewicz !! Could you estimate when it could be solved?
Hey @aresrioja10, I don't have an estimate for you at this time.
It turns out that this has been a problem for a long time, and it's a shame that it hasn't been solved yet