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

fix: parse declaration error #450

Merged
merged 1 commit into from Jul 6, 2022
Merged

fix: parse declaration error #450

merged 1 commit into from Jul 6, 2022

Conversation

ycs77
Copy link
Contributor

@ycs77 ycs77 commented Jul 5, 2022

unplugin-vue-components version: 0.21.0

If using the component like <IMdi:diceD12>, expected generated components.d.ts file is:

declare module '@vue/runtime-core' {
  export interface GlobalComponents {
    ...
    IFaSolidDiceFive: typeof import('~icons/fa-solid/dice-five')['default']
    IHeroiconsOutlineMenuAlt2: typeof import('~icons/heroicons-outline/menu-alt2')['default']
    'IMdi:diceD12': typeof import('~icons/mdi/dice-d12')['default']
    IMdiLightAlarm: typeof import('~icons/mdi-light/alarm')['default']
    ...
  }
}

But the component name has : char, now the actual generated components.d.ts file is:

declare module '@vue/runtime-core' {
  export interface GlobalComponents {
    ...
    IFaSolidDiceFive: typeof import('~icons/fa-solid/dice-five')['default']
    IHeroiconsOutlineMenuAlt2: typeof import('~icons/heroicons-outline/menu-alt2')['default']
    IMdi: diceD12': typeof import('~icons/mdi/dice-d12')['default']
    'IMdi:diceD12': typeof import('~icons/mdi/dice-d12')['default']
    IMdiLightAlarm: typeof import('~icons/mdi-light/alarm')['default']
    ...
  }
}

This PR will resolve the bug.

@ycs77 ycs77 requested a review from antfu as a code owner July 5, 2022 17:24
@antfu antfu merged commit 16e9ada into unplugin:main Jul 6, 2022
@ycs77 ycs77 deleted the fix-parse-declaration-error branch July 6, 2022 05:13
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

2 participants