#Help generating proper types for my published package

5 messages · Page 1 of 1 (latest)

paper pilot
#

Hey! I'm using Rollup to try and publish my own component library to NPM. I have the publishing working fine, but when I try and install it in another project, it complains about not having the proper types to be installed in a typescript project.

Best I can tell this is because there's no module declaration in the outputted dist folder for the consumer to look at, but I'm honestly new to rollup/esm/bundling and not sure. I've included a repo (with the dist folder pushed) for debugging. Any help is appreciated! Thanks in advance 🙂

https://github.com/bryanhoulton/slate

GitHub

Slate is an opinionated, configurable React component library built for scalable dev teams on Tailwind and Radix. - bryanhoulton/slate

leaden whale
#

@paper pilot Looks like your package.json says the types entry point is dist/index.d.ts, but there isn't a file there

#

Can probably set it to either dist/cjs/index.d.ts or dist/esm/index.d.ts - they're probably identical

ebon yacht
#

Surely the final application will bundle your package in with its code itself.

paper pilot
#

@leaden whale that worked, thanks!