unjs / mkdist

Lightweight file-to-file transpiler.
MIT License
357 stars 25 forks source link

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

Open yusufkandemir opened 6 months ago

yusufkandemir commented 6 months ago

๐Ÿ”— Linked issue

Resolves #209

โ“ Type of change

๐Ÿ“š Description

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

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

danielroe commented 4 months ago

Would you be able to look at the failing test? ๐Ÿ™

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 95.65217% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.68%. Comparing base (9000888) to head (d5b65ae). Report is 56 commits behind head on main.

Files with missing lines Patch % Lines
src/loaders/vue.ts 95.65% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #210 +/- ## ========================================== - Coverage 82.86% 81.68% -1.19% ========================================== Files 12 12 Lines 852 868 +16 Branches 133 191 +58 ========================================== + Hits 706 709 +3 - Misses 144 157 +13 Partials 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.