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

feat(resolver): adds component resolver for VueUse components #47

Merged
merged 4 commits into from
May 28, 2021
Merged

feat(resolver): adds component resolver for VueUse components #47

merged 4 commits into from
May 28, 2021

Conversation

wheatjs
Copy link
Contributor

@wheatjs wheatjs commented May 25, 2021

Added a resolver for vueuse components.

* @link https://github.com/vueuse/vueuse
*/
export const VueUseComponentsResolver = (): ComponentResolver => (name: string) => {
if (name.toLowerCase().startsWith('use') || name.toLowerCase().startsWith('on'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (name.toLowerCase().startsWith('use') || name.toLowerCase().startsWith('on'))
if (/^(?:Use|On)[A-Z]/.test(name))

Tho I still thinking maybe we should read the indexes.json to have more accurate match.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah that would be a much better way I think. Any preferred way we should go about reading indexes.json?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should ship it along with the package

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should do in 5.0.0-beta.3:

require('@vueuse/core/indexes.json')

@antfu antfu changed the title feat(VueUse Components): adds component resolver for VueUse components feat(resolver): adds component resolver for VueUse components May 28, 2021
@antfu antfu merged commit 953c7ba into unplugin:master May 28, 2021
ascott18 pushed a commit to ascott18/unplugin-vue-components that referenced this pull request Mar 4, 2023
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.

2 participants