Repository navigation
fix(kysely-tailordb): stop depending on the global Tailordb namespace - #224
Merged
Merged
Conversation
The published declarations referenced `Tailordb.Client`, a global type namespace that only the deprecated @tailor-platform/function-types declares. Without that package, consumers that do not skip library checks got TS2833 (or TS2503 when no ambient types were loaded at all). Describe the client by the three methods the dialect calls instead. Both the legacy `Tailordb.Client` and the `tailordb.Client` of @tailor-platform/sdk are assignable to it, and runtime behavior is unchanged. The package no longer needs function-types for its own type check, so drop it from tsconfig and devDependencies, and point the README at the SDK runtime globals.
…are accepted Add a type-only test that passes both the legacy `Tailordb.Client` of @tailor-platform/function-types and the `tailordb.Client` of @tailor-platform/sdk to TailordbDialect. If either package changes the shape of its client in a way the dialect cannot accept, type-check now fails, including when Renovate bumps the SDK. The test needs the SDK exports map to resolve, so it has its own tsconfig with bundler module resolution and type-check runs both.
toiroakr
force-pushed
the
fix/kysely-tailordb-client-type
branch
from
November 11, 2026 08:01
9da33a9 to
a7c49a9
Compare
toiroakr
marked this pull request as ready for review
November 11, 2026 12:39
toiroakr
enabled auto-merge (squash)
November 11, 2026 12:40
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dist/index.d.tshadconstructor(client: Tailordb.Client).Tailordbis a global type namespace that only@tailor-platform/function-typesdeclares, and that package is deprecated (docs(types): deprecate function-types in favor of @tailor-platform/sdk #190). Without it, a project that type-checks library declarations (skipLibCheck: false) getsTS2833: Cannot find namespace 'Tailordb', orTS2503when no ambient types are loaded at all. TypeScript 5.9.3, 6.0.3 and 7.1 report the same error.TailordbDialectnow takes aTailordbClientthat the package defines itself: just the three methods the dialect calls (connect,end,queryObject). Both the legacyTailordb.Clientand thetailordb.Clientof@tailor-platform/sdkare assignable to it. The change is types only; runtime behavior is the same.function-typesfor its own type check, sotsconfig.jsonanddevDependenciesdrop it. The README now points at the runtime globals of@tailor-platform/sdk.kysely-tailordb-codegenis not touched and still depends onfunction-types.type-tests/client-compat.ts) passes both clients toTailordbDialect, andtype-checkruns it.@tailor-platform/sdkandfunction-typesaredevDependenciesfor that, so a Renovate bump of either package that changes the client shape fails CI.Why not rename
Tailordb.Clientto the lowercasetailordb.Clientinstead: that is what@tailor-platform/sdkdeclares, but projects that still use onlyfunction-types(which declares the type namespace asTailordbandtailordbonly as a value) would newly getTS2833.Type-checking
dist/index.d.tswithskipLibCheck: false(TypeScript 5.9.3,@tailor-platform/sdk2.40.0,@tailor-platform/function-types0.10.2):function-typesonly@tailor-platform/sdkruntime globals onlyTS2833TS2503