ismail9k / vue3-carousel

Vue 3 carousel component
https://ismail9k.github.io/vue3-carousel/
MIT License
660 stars 164 forks source link

TypeScript types don't get published to NPM #184

Closed fabis94 closed 1 year ago

fabis94 commented 2 years ago

Describe the bug This package does generate TS typings (.d.ts) files and even references them in the package.json "types" field, but the "dist/index.d.ts" field doesn't actually exist in the published npm package tarball. Maybe it's removed by something (I don't see anything offending in .npmignore), but whatever the case may be, TypeScript types are broken for this package.

To Reproduce Just npm i the latest version and check the package contents in node_modules

Expected behavior dist/index.d.ts should be available in the package tarball

fabis94 commented 2 years ago

I built this repo locally and it looks like the actual location of the types is dist/src/index.d.ts. And it's the src in .npmignore that leaves it out of the tarball.

EDIT: Additionally, it looks like the import calls in the .d.ts files are broken, e.g. dist/src/components/Carousel.d.ts tries to resolve types from @/types, but it can't figure out such an import. Typescript path transforms should be used to convert the aliased imports to real relative paths

07JP27 commented 1 year ago

I'm facing same issue. Are there any workarounds until fixed this bug?

fabis94 commented 1 year ago

I'm facing same issue. Are there any workarounds until fixed this bug?

Augment the types yourself - create a .d.ts file with a declare module 'vue3-carousel' block and fill it with the types from the actual types file you can build when checking out this project locally.

... or use swiper.js

07JP27 commented 1 year ago

@fabis94 Thank you! I will try.

ismail9k commented 1 year ago

fixed in v0.1.43