H
Hono2mo ago
veeque

Best way to export types for use in a separate app with `hc` client

I have a monorepo where one folder contains the Hono app, and another a SvelteKit one. How best do I make the type available to the SvelteKit project for use with the hc client?
2 Replies
ambergristle
ambergristle2mo ago
a shared types.d.ts seems like a good place to start idk that it really matters as long as it's clear + consistent w the app architecture overall
Sakib
Sakib2mo ago
I usually build the hono app with tsup which provides the types, then on the other app I installed the hono app as a devDependencies now you can import the types without changing anything. I tried sharing types with composite. but it gives errors sometimes. make sure you add the "types":"./dist/index.d.ts" in your package.json

Did you find this page helpful?