vueuse / motion

🤹 Vue Composables putting your components in motion
https://motion.vueuse.org
MIT License
2.13k stars 75 forks source link

build: update unbuild and emit `.d.mts` and `.d.cts` as well #164

Closed danielroe closed 5 months ago

danielroe commented 6 months ago

This bumps unbuild to v2 to emit .d.ts files so users using TypeScript bundler module resolution can get the types for this module.

Without this, the following error (for example) would be printed:

components/modal/ModalMediaPreviewCarousel.vue:4:34 - error TS7016: Could not find a declaration file for module '@vueuse/motion'. '/Users/daniel/code/elk-zone/elk/node_modules/.pnpm/@vueuse+motion@2.0.0_rollup@2.79.1_vue@3.3.9/node_modules/@vueuse/motion/dist/index.mjs' implicitly has an 'any' type.
  There are types at '/Users/daniel/code/elk-zone/elk/node_modules/@vueuse/motion/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@vueuse/motion' library may need to update its package.json or typings.

4 import { useReducedMotion } from '@vueuse/motion'
lennartzellmer commented 6 months ago

Would looove to see this merged!