ElMassimo / iles

🏝 The joyful site generator

Home Page:https://iles.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

rsek opened this issue Β· comments

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 .

commented

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