Repository navigation
chore(deps): update kysely-codegen to v0.20.0 - #226
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.
Kysely 0.29 makes `TableMetadata.isForeign` required, so the copy of the PostgreSQL introspector's `parseTableMetadata` in kysely-tailordb-codegen no longer type-checks. Fill it in from `table_type`, the way Kysely's own introspector does (`relkind` `f` is a foreign table), and point the link in the comment at the 0.29.8 source.
- typescript 5.9.3 -> 6.0.3 (kysely-tailordb, kysely-tailordb-codegen, logger). TypeScript 7 is not an option yet: tsup builds the declarations through rollup-plugin-dts, which needs the TypeScript compiler API that 7.0 no longer provides. - tsup 8.5.1 -> 9.0.0. - esbuild 0.28.1 -> 0.28.2. - @types/node 22.20.5 -> 24.19.2, to match the Node 24 the repository declares in engines.
The CLI of kysely-tailordb-codegen only uses `requiredOption`, `opts` and `error`, and its `--help` output and the error for a missing option are the same as before. commander 15 requires Node.js 22.12 or later, which is below the Node 24 the repository declares in engines. kysely-codegen stays on 0.18.5: bundling 0.20.0 into function.js produces a file that fails to load with `__filename is not defined in ES module scope`.
Migrate the biome.json of kysely-tailordb and kysely-tailordb-codegen to the 2.x schema, keeping the same formatting and lint settings. Two things differ from 1.9: `vcs.root` has to point at the repository root for biome to find .gitignore, and `**/*.md` is excluded from the formatter because 2.x would otherwise start formatting the READMEs. The two `biome-ignore` comments in kysely-tailordb now carry a reason, which 2.x requires.
@changesets/cli 2.31.1 -> 3.0.3 and @changesets/changelog-github 0.7.0 -> 1.0.1. `changeset status` reads the existing config and the pending changesets without changes.
The only dependency whose range moved when updating within the declared ranges. The CLI of kysely-tailordb-codegen builds and prints the same `--help` output, and the generated code for a mocked TailorDB client is the same as before.
The two entries were temporary exceptions for Renovate security updates to kysely 0.28.17 and esbuild 0.28.1. Neither version is in the lockfile any more, so the exceptions no longer match anything.
commander 15 requires Node.js 22.12 or later, while 14 runs on Node 20 and kysely-tailordb-codegen declares no engines. Updating it in a patch release would silently drop Node 20 for the CLI, so leave it out of this update and decide the Node floor, or a different CLI library, separately.
Build kysely-tailordb with tsdown 0.23.7. `fixedExtension: false` keeps the output names as they were (`index.js`, `index.cjs`, `index.d.ts` and `index.d.cts`), so package.json needs no change to `main`, `module`, `types` and `exports`. The ESM and CommonJS builds export the same `TailordbDialect` and run the same way against a mocked client, and the declarations type-check in the same three environments as before. TypeScript stays on 6.0.3.
typescript 6.0.3 -> 7.0.2 in kysely-tailordb, kysely-tailordb-codegen and logger. With tsdown in place of tsup, all three packages build and type-check on 7.0.2, the declarations of kysely-tailordb still type-check with and without function-types or the SDK runtime globals, and the CLI and generated code of kysely-tailordb-codegen are unchanged. tsdown warns that the tsgo declaration generator for TypeScript 7.0 is deprecated and will be removed in the next minor, so revisit this when TypeScript 7.1 is out.
kysely-codegen 0.20 parses type expressions with the TypeScript compiler API, but it declares typescript neither as a dependency nor as a peer dependency. When function.js is bundled, esbuild therefore picks up whichever typescript is installed here. With TypeScript 6 that is a 4.6 MB CommonJS bundle that refers to `__filename`, so function.js fails to load with `__filename is not defined in ES module scope`. With TypeScript 7.0.2 only a small placeholder file is bundled, which loads but depends on the installed version. The only call, `extractTypeIdentifiers`, is wrapped in try/catch and only matters for custom imports and overrides, which src/function.ts does not pass. Replace typescript with an empty module in the same mockPackages plugin that already stubs git-diff and cosmiconfig, so the bundle no longer depends on the TypeScript version. function.js, built with either TypeScript 6.0.3 or 7.0.2, produces the same generated code as with kysely-codegen 0.18.5, both for a mocked column metadata table and when run on a workspace with four TailorDB tables. The CLI prints the same --help and the same missing-option error as before.
git-diff is no longer a dependency of kysely-codegen 0.20 (it uses diff), so the stub for it in mockPackages matched nothing. Drop it, and say in the comment that the stubbed typescript only breaks the bundle on 6.x.
toiroakr
marked this pull request as ready for review
November 11, 2026 13:50
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
kysely-codegento 0.20.0 forkysely-tailordb-codegen. chore(deps): update dependencies and support Kysely 0.29 #225 left it at 0.18.5 because the bundledfunction.jsfailed to load with__filename is not defined in ES module scope.typescriptneither as a dependency nor as a peer dependency. esbuild therefore bundles whichevertypescriptis installed in this package. TypeScript 6 brings in a 4.6 MB CommonJS bundle that refers to__filename, sofunction.jscannot load as an ES module. TypeScript 7.0.2 only brings in a small placeholder, which loads but makes the result depend on the installed version.typescripttomockPackagesinbuild.js, which already replacescosmiconfigwith an empty module. The only call,extractTypeIdentifiers, is wrapped in try/catch, and its result matters only for custom imports and overrides, whichsrc/function.tsdoes not pass. Bundling the real compiler instead would makefunction.jsabout 4.6 MB larger and still need__filenameto be defined. The stub forgit-diffis dropped because 0.20.0 no longer uses it.function.jsbuilt with TypeScript 7.0.2 and with 6.0.3 is the same size and generates the same code as with 0.18.5.Category,Comment,Task,User) and a machine user. Running the 0.18.5 and the 0.20.0function.jswithtailor function test-runboth succeed and produce the same generated code (1824 bytes). Runningnode dist/cli.js -a tailordb -n main-db -m admin -o out.tsagainst that workspace writes the same file, and its--helpoutput and the error for a missing option are the same as before.main.