ElMassimo/iles

3rd-party components with "Layout" in the name generate incorrect import paths in `components.d.ts`

rsek opened this issue ยท 2 comments

rsek commented
  • I have read the [troubleshooting section] before opening an issue.
  • I have tried upgrading iles and vite.

Description ๐Ÿ“–

So far I've been able to reproduce this with both Vuetify (VLayout) and Inkline (ILayout). This is with the appropriate resolvers (Vuetify3Resolver, InklineResolver) from unplugin-vue-components/resolvers.

// iles.config.ts
import { defineConfig } from 'iles'
import { Vuetify3Resolver } from 'unplugin-vue-components/resolvers'

export default defineConfig({
	vite: {
		ssr: { noExternal: ['vuetify'] }
	},
	components: {
		dirs: ['src/components', 'node_modules/vuetify'],
		resolvers: [Vuetify3Resolver()]
	}
})
 // components.d.ts
declare module '@vue/runtime-core' {
  export interface GlobalComponents {
    // ...
    VLayout: typeof import('./src/layouts/v.vue')['default'] // expected: typeof import('vuetify/components')['VLayout']
    // ...
    VList: typeof import('vuetify/components')['VList']
    VListItem: typeof import('vuetify/components')['VListItem']
    VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
  }
}

Reproduction ๐Ÿž

Available here. This reproduces it with Vuetify, but the same pattern is apparent with Inkline's ILayout, where it points to src/layouts/i.vue instead of src/layouts/v.vue.

Dependencies Info

Run npx iles info and pnpm list (or npm list) and provide the output:

npx iles info: iles v0.9.2 vite v4.1.4

npm list:

iles-layout-bug@0.0.0 /home/rsek/Development/GitHub/iles-layout-bug-repro
โ”œโ”€โ”€ iles@0.9.2
โ”œโ”€โ”€ npm@9.5.1
โ”œโ”€โ”€ sass@1.58.3
โ”œโ”€โ”€ typescript@4.9.5
โ”œโ”€โ”€ vite@4.1.4
โ”œโ”€โ”€ vue-tsc@0.38.9
โ””โ”€โ”€ vuetify@3.1.6

Thanks for reporting @rsek, and for providing a minimal reproduction!

Fixed in iles@0.9.4 .

rsek commented

Great, thanks for the fix! :) ๐Ÿš€