Skip to content

Fix drizzle-kit tsconfig path alias resolution#5417

Open
dankochetov wants to merge 16 commits intobetafrom
fix-jiti-tsconfig-paths
Open

Fix drizzle-kit tsconfig path alias resolution#5417
dankochetov wants to merge 16 commits intobetafrom
fix-jiti-tsconfig-paths

Conversation

@dankochetov
Copy link
Contributor

@dankochetov dankochetov commented Mar 2, 2026

Summary

  • resolve tsconfig path aliases in drizzle-kit loader using get-tsconfig + jiti alias mapping
  • add fixtures and tests covering wildcard and non-wildcard path aliases
  • ensure schema load succeeds for alias imports

Notes

Fixes #5365

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Copilot AI review requested due to automatic review settings March 2, 2026 14:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a regression in drizzle-kit’s TS module loading by resolving tsconfig.json path aliases when loading schema/config modules via jiti, and adds tests/fixtures to validate wildcard and non-wildcard alias imports.

Changes:

  • Add get-tsconfig dependency and use it to read compilerOptions.paths / baseUrl.
  • Build a jiti alias map from tsconfig paths inside loadModule().
  • Add fixtures + Vitest coverage for alias-based schema imports and CLI config loading.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds lock entries for get-tsconfig and updates dependent snapshots.
drizzle-kit/package.json Adds get-tsconfig as a runtime dependency.
drizzle-kit/src/utils/utils-node.ts Updates loadModule() to read tsconfig and configure jiti aliases accordingly.
drizzle-kit/tests/other/load-module.test.ts Adds a direct test ensuring loadModule() can load a TS module that uses tsconfig aliases.
drizzle-kit/tests/other/cli-generate.test.ts Adds a CLI test ensuring generate succeeds with schema imports using aliases.
drizzle-kit/tests/fixtures/tsconfig-paths/tsconfig.json Fixture tsconfig with wildcard and non-wildcard paths.
drizzle-kit/tests/fixtures/tsconfig-paths/src/user/schema.ts Fixture schema importing via both alias styles (@/* and @profile).
drizzle-kit/tests/fixtures/tsconfig-paths/src/profile/schema.ts Fixture profile schema.
drizzle-kit/tests/fixtures/tsconfig-paths/entry.ts Fixture entrypoint exporting schemas.
drizzle-kit/tests/fixtures/tsconfig-paths/drizzle.config.ts Fixture drizzle config referencing the alias-using schema entry.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

dankochetov and others added 4 commits March 2, 2026 16:54
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.

5 participants