unjs/db0

Type issue with integrations

Closed this issue · 4 comments

Environment

"db0": "^0.1.4",
"drizzle-orm": "^0.31.2"

node@20.14

Reproduction

Write import { drizzle } from "db0/integrations/drizzle"; in any project and the IDE will tell you that types does not exists.

Describe the bug

Hey,

I'm trying to use this integration: https://db0.unjs.io/integrations/drizzle but my IDE complains about types.

Screenshot 2024-07-04 at 19 51 48

While trying to understand why this could happens, it seems to be an issue with the compilation step where the ../../types does not exists anymore since every thing move to dist except integrations and connectors because of mkdist.

Screenshot 2024-07-04 at 19 45 46

Additional context

No response

Logs

No response

@Barbapapazes, this worked for me...

import { drizzle } from "db0/integrations/drizzle/index";

@Barbapapazes, this worked for me...

import { drizzle } from "db0/integrations/drizzle/index";

Oohh ok, I'll give a try (but adding /index at the end, seems to be more a workaround than a normal behavior).

It works but not really because the type Database cannot be resolved so you can pass a string to the Drizzle integration and TypeScript won't complain.

pi0 commented

fixed with c48530c