unplugin-vue-components icon indicating copy to clipboard operation
unplugin-vue-components copied to clipboard

components.d.ts does not update when component file added/deleted

Open zhuscat opened this issue 1 year ago • 7 comments

Describe the bug

components.d.ts does not update when file added/deleted in src/components(using vue cli, pnpm serve is running).

I'm also using Nuxt, I noticed that in Nuxt when file created/deleted in components directory, components.d.ts will update. So I'm wondering if this is a BUG.

Reproduction

https://github.com/zhuscat/test-unplugin-vue-components

System Info

System:
    OS: macOS 13.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 2.91 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.15.0/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
    pnpm: 8.6.1 - ~/.nvm/versions/node/v16.15.0/bin/pnpm
  Browsers:
    Chrome: 114.0.5735.198
    Safari: 16.4

Used Package Manager

pnpm

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

zhuscat avatar Jul 04 '23 01:07 zhuscat

vite 里也有这个问题

lanpangzhi avatar Jul 05 '23 06:07 lanpangzhi

In my test, the new addition will be added automatically, delete it is not, delete this can be optimized

lishaobos avatar Jul 06 '23 02:07 lishaobos

Same issue here. Imports are added, but not removed. Is there a way to manually remove imports from / update the components file?

memen45 avatar Aug 17 '23 11:08 memen45

而且在vite里面你重命名组件也只是新增了重命名组件后的文件,不是直接修改旧的或者将旧的删除,还是有什么参数没加吗

l1548844035 avatar Sep 22 '23 06:09 l1548844035

I agree, addition of component update the components.d.ts file, but deletion of component doesn't.

The current solution is to let the wrong components into the components.d.ts file, remove manually the components from the file, or delete the components.d.ts and recreate it. Not really ergonomic, and I think it could be easy to detect this change.

tassin-gauthier avatar Sep 25 '23 10:09 tassin-gauthier

Yeah this is also an issue for me, should auto delete the old stuff.

digisomni avatar Oct 10 '23 15:10 digisomni

any update on this issue? I currently have to restart my dev server every time I add a new component, really painful! Thanks in advance!

Kasopej avatar Nov 14 '23 22:11 Kasopej