mkdist icon indicating copy to clipboard operation
mkdist copied to clipboard

feat(dts): transform vue script setup if no type-only macros

Open yusufkandemir opened this issue 11 months ago โ€ข 2 comments

๐Ÿ”— Linked issue

Resolves #209

โ“ Type of change

  • [x] ๐Ÿ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [x] ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • [ ] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

Some macros in <script setup> have a type-only variant:

  • defineProps
  • defineEmits
  • defineSlots
  • defineModel

As long as their type-only variant is NOT used, they can safely be transformed into JS. So, this PR improves the exclusion logic to exclude <script setup> only if the file contains some type-only macro usage.

๐Ÿ“ Checklist

  • [x] I have linked an issue or discussion.
  • [x] I have updated the documentation accordingly.

yusufkandemir avatar Apr 01 '24 15:04 yusufkandemir