primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
9.26k stars 1.13k forks source link

Nuxt autoimport component prefix: add typescript dynamic name support #6007

Open ReWWeR opened 1 month ago

ReWWeR commented 1 month ago

Describe the bug

When added in nuxt.config prefix for component, then IDE doesn't see the new component name, it takes types from node_modules folder, where the names of the components are written without prefix.

Reproducer

https://stackblitz.com/edit/primevue-4-ts-vite-issue-template-csnodp?file=README.md

PrimeVue version

4.0.0

Vue version

4.x

Language

TypeScript

Build / Runtime

Nuxt

Browser(s)

No response

Steps to reproduce the behavior

  1. add in nuxt.config components: { prefix: 'Pv' }
  2. add button in any .vue file <pv-button label="Check 2" icon="pi pi-check" />
  3. It works, but IDE will show an error, that it is unknown custom HTML tag

Expected behavior

IDE should take new type name

mertsincan commented 3 weeks ago

I'll try with dts: true; https://github.com/primefaces/primevue/blob/master/packages/nuxt-module/src/module.ts#L66

sparrow-chik-chrk commented 3 weeks ago

Indeed, auto-import stopped working properly when upgrading from version v4.0.0-rc3 to v4.0.0. Not only did the prefixes break, but also the styles.