Interactions-as-a-Service / d1-orm

A simple, strictly typed ORM, to assist you in using Cloudflare's D1 product
https://docs.interactions.rest/d1-orm/
Apache License 2.0
161 stars 10 forks source link

Add d1 types for d1-orm lib #80

Closed fwqaaq closed 2 months ago

fwqaaq commented 2 months ago

When using this library, there are many type errors due to the lack of types for D1.

changeset-bot[bot] commented 2 months ago

⚠️ No Changeset found

Latest commit: 17aa4e678f877e86f835c74a9ae5ef72c07b029e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Skye-31 commented 2 months ago

Hey there - I've just tried a fresh worker using the library, and can't see any typing issues - do you have @cloudflare/workers-types in your tsconfig?

fwqaaq commented 2 months ago

Yeah, but my JavaScript runtime is node. Just like this:

image
Skye-31 commented 2 months ago

Could you share a minimal repro where I can see this?

fwqaaq commented 2 months ago

Could you share a minimal repro where I can see this?

I'm going to deliver the goods today. Please wait a moment.

fwqaaq commented 2 months ago

https://github.com/fwqaaq/test-d1-orm-type

I can't find d1 types when I click into d1-orm lib.

Skye-31 commented 2 months ago

I see the confusion here - we're publishing the src directory of the project for no reason, you actually want to be looking at the lib directory. I've fixed this in the latest version