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

fix(docgen): add expanded type name when union uses in define-props ts annotation #1396

Closed
wants to merge 8 commits into from
Closed

fix(docgen): add expanded type name when union uses in define-props ts annotation #1396

wants to merge 8 commits into from

Conversation

avinean
Copy link

@avinean avinean commented Sep 2, 2022

Fix displaying union types as 'union' instead of 'string | number | boolean'

For example if I have such component

  defineProps<{
      /**
     * Size of the button that determine font size and paddings size
     */
    size: 'xs' | 'sm' | 'md' | 'lg'
  }>()

I would expect to see this in args table
image

What I see instead
image

I assume PR will close this storybookjs/storybook#16301

@changeset-bot
Copy link

changeset-bot bot commented Sep 2, 2022

🦋 Changeset detected

Latest commit: 6e74e49

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vue-docgen-api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@elevatebart
Copy link
Member

This change is a breaking change in the API. I will implement it, merge it, at the same time as I merge true TypeScript support. It will be in vue-docgen-api 5.0.

Working on it with @johnsoncodehk, the author of volar.

See more at
https://github.com/johnsoncodehk/volar/tree/master/packages/vue-component-meta

I wish I could say more about the timeline.

@codecov
Copy link

codecov bot commented Sep 5, 2022

Codecov Report

Merging #1396 (9aa4201) into dev (65407ea) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 9aa4201 differs from pull request most recent head 6e74e49. Consider uploading reports for the commit 6e74e49 to get more accurate results

@@           Coverage Diff           @@
##              dev    #1396   +/-   ##
=======================================
  Coverage   88.38%   88.39%           
=======================================
  Files         113      113           
  Lines        8466     8471    +5     
  Branches     1174     1177    +3     
=======================================
+ Hits         7483     7488    +5     
  Misses        949      949           
  Partials       34       34           
Impacted Files Coverage Δ
.../vue-docgen-api/src/utils/getTypeFromAnnotation.ts 88.33% <100.00%> (+0.50%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@elevatebart
Copy link
Member

elevatebart commented Sep 5, 2022

Let me rephrase that...

First, this is a great PR.
There is tests, a great description and a very good use case.
Thank you for that.

Unfortunately, we are not yet at a point where this can be merged in the dev branch and I have not started the next branch.

Sorry about that,
I will keep you posted.

@cypress
Copy link

cypress bot commented Sep 9, 2022



Test summary

49 0 0 0


Run details

Project vue-styleguidist
Status Passed
Commit 6e74e49
Started Oct 27, 2022 3:56 PM
Ended Oct 27, 2022 3:59 PM
Duration 02:26 💡
OS Linux Debian - 11.3
Browser Electron 102

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@jnarowski
Copy link

jnarowski commented Oct 18, 2022

I need this too. Without it the vue3+typescript setup is very hard to use.

Any idea on timeline or work arounds in the meantime?

@stale
Copy link

stale bot commented Jun 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale more than 60 days without activity label Jun 18, 2023
@thomasaull
Copy link

Dear stalebot, please don‘t close this issue automatically 🤝

@stale stale bot removed the stale more than 60 days without activity label Jun 18, 2023
@elevatebart elevatebart added the intend to implement Sometime in the next 2 major release this will be implemented label Jun 18, 2023
@avinean avinean closed this by deleting the head repository Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking (needs major) intend to implement Sometime in the next 2 major release this will be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants