mkdist icon indicating copy to clipboard operation
mkdist copied to clipboard

Improve Vue <script setup lang="ts"> handling

Open yusufkandemir opened this issue 11 months ago • 1 comments

Describe the feature

Currently, <script setup lang="ts"> is being completely bypassed, as of #15. However, bypassing should only be needed when using type-only macros, e.g. defineProps<{ foo: number }>()(not defineProps({ foo: Number })).

So, to improve this:

  • Quick and acceptable solution: do not exclude files that don't have any type-only macros
  • Best solution: avoid bypassing completely by converting type-only macros to their runtime definition counterparts, e.g. convert defineProps<{ foo: number }>() to defineProps({ foo: number }). This may be complex to implement, and may even require help from the Vue team. The reverse of https://github.com/sapphi-red/vue-convert-to-script-setup-from-composition-api may work.

I will implement the "quick and acceptable solution" soon.

Additional information

  • [X] Would you be willing to help implement this feature?

yusufkandemir avatar Apr 01 '24 15:04 yusufkandemir