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

Adds Vue3 setup support #749

Merged
merged 5 commits into from Mar 29, 2023
Merged

Adds Vue3 setup support #749

merged 5 commits into from Mar 29, 2023

Conversation

devan1011
Copy link
Contributor

Adds support for Vue 3 composition <script setup> components. As <script> and <script setup> are allowed in the same file I just concat the two files together as it's only import parsing that is required.

Also adds supports for typescript parsing in Vue components.

@codecov-commenter
Copy link

Codecov Report

Merging #749 (dc86647) into main (f9eb0ed) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #749      +/-   ##
==========================================
+ Coverage   98.29%   98.30%   +0.01%     
==========================================
  Files          50       50              
  Lines        1052     1057       +5     
==========================================
+ Hits         1034     1039       +5     
  Misses         18       18              
Impacted Files Coverage Δ
src/parser/vue.js 90.00% <100.00%> (+10.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5132d5e...dc86647. Read the comment docs.

@xibman
Copy link

xibman commented Sep 7, 2022

👍 for this one !

@stale
Copy link

stale bot commented Jan 7, 2023

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

@stale stale bot added the wontfix label Jan 7, 2023
@rumpl rumpl removed the wontfix label Mar 28, 2023
@BenJackGill
Copy link

Would also love Vue 3 support.

+1 from me also!

@rumpl
Copy link
Member

rumpl commented Mar 29, 2023

I merged the Vue3 support yesterday (#778), I never did any vue so I'm not sure if this PR adds something more than the other? @devan1011

@devan1011
Copy link
Contributor Author

Main difference is I concat the script and setupScript as in Vue 3 it is valid to have for example:

<script lang="ts">
export default {
  name: 'ComponentName',
};
</script>

<script setup lang="ts">
// ...
</script>

I had a use case where there where imports in both scripts, and didn't want to loose the deps in the first script tag.

@rumpl rumpl merged commit da616e7 into depcheck:main Mar 29, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants