Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: patch kysely types for dynamic selections 🩹 #119

Merged
merged 5 commits into from
Apr 7, 2024

Conversation

ramiAbdou
Copy link
Member

@ramiAbdou ramiAbdou commented Apr 7, 2024

Description ✏️

We're experiencing a really annoying Typescript error (which doesn't break the build):

The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary.

There's a bunch of issues out there about this, here is one in the Typescript repository.

To fix this, we need kysely to export some additional types, so instead of waiting ourselves, we should manually added a kysely-patch.d.ts file as follows:

import type {} from '../../node_modules/kysely/dist/esm/dynamic/dynamic-reference-builder';
import type {} from '../../node_modules/kysely/dist/esm/util/type-utils';

declare module 'kysely' {
  export * from '../../node_modules/kysely/dist/esm/dynamic/dynamic-reference-builder';
  export * from '../../node_modules/kysely/dist/esm/util/type-utils';
}

Type of Change 🐞

  • Feature - A non-breaking change which adds functionality.
  • Fix - A non-breaking change which fixes an issue.
  • Refactor - A change that neither fixes a bug nor adds a feature.
  • Documentation - A change only to in-code or markdown documentation.
  • Tests - A change that adds missing unit/integration tests.
  • Chore - A change that is likely none of the above.

Checklist ✅

  • I have done a self-review of my code.
  • I have manually tested my code (if applicable).
  • I have added/updated any relevant documentation (if applicable).

@ramiAbdou ramiAbdou self-assigned this Apr 7, 2024
@ramiAbdou ramiAbdou marked this pull request as ready for review April 7, 2024 20:07
@ramiAbdou ramiAbdou merged commit b54a9f7 into main Apr 7, 2024
1 check passed
@ramiAbdou ramiAbdou deleted the rami/fix-type-annotation branch April 7, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant