Closed Blankeos closed 7 months ago
Why you want this? (first of all, it's hard to implement ...) I think this is a fake requirement, refer to #302.
No worries! Just wondering.
Why I want this? I wrote it above. But for more context: I have separate client and backend repos for ElysiaJS. It's a typesafe backend like tRPC and similarly, it only works in monorepos, or if the type definitions are shared via an npm package. I have a polyrepo client
and backend
separate repos.
In any case, vite-plugin-dts already takes care of the transpilation for me. The type definitions from external libraries are also pretty much at the top anyway. So my work-around would be just to reinstall the types via the client repo (bun install -D @types/*
)
Will be closing this now! Thanks!
Description
Context
My goal currently is to generate the
App
type for my ElysiaJS server (basically the same as tRPC). So I can use it for my client on the frontend.So far it works great. Here's my Config:
It then generates a file like this:
I can basically serve this on an endpoint and I can consume it on my frontend for my client by saving it somewhere in
src
after acurl
script. It's super cool since I wouldn't need to share these types via an intermediary npm package.The Feature Request
Is there any way we can also "inline" the types from external dependencies? 'elysia', 'geojson', 'lucia' for example. So that I wouldn't need to
bun add -D @types/elysia @types/geojson @types/lucia
on the client.Suggested solution
Not too sure...
A great API addition would probably be
dts({ rollupTypes: true, inlineExternalDeps: true })
though.Alternative
No response
Additional context
No response
Validations