Skip to content

feat(component): Add support for better naming of /index.vue components #1994

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

niksy
Copy link
Contributor

@niksy niksy commented Nov 26, 2022

Description

This PR relates to vuejs/devtools#387. Sometimes developers have components nested inside directories and follow classic Node approach of naming them /index.${extenstion}, in this case /index.vue. Devtools currently display every component as <Index> unless you specify name. This PR will check for those components and use parent directory as component name.

Example

Compnent is defined in src/IndexComponent/index.vue

Before:

Screenshot 2022-11-26 at 12 08 48

After:

Screenshot 2022-11-26 at 12 08 08

Additional context

I’ve also taken the chance to use basename function from @vue/shared-utils and removed same command form Vue 3 backend namespace.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).

@niksy niksy marked this pull request as ready for review November 26, 2022 11:17
@niksy niksy changed the title Add support for better naming of /index.vue components feat: Add support for better naming of /index.vue components Nov 26, 2022
@niksy
Copy link
Contributor Author

niksy commented Jan 18, 2024

Any chance of getting this merged? It would really help DX when looking for specific component in component tree.

@Akryum Akryum changed the title feat: Add support for better naming of /index.vue components feat(component): Add support for better naming of /index.vue components Feb 4, 2024
@Akryum Akryum merged commit 687d238 into vuejs:main Feb 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants