Repository navigation
fix(cli): resolve tsconfig aliases in database seeds - #873
Open
karthickeyan-dev wants to merge 5 commits into
Open
karthickeyan-dev wants to merge 5 commits into
karthickeyan-dev wants to merge 5 commits into
Conversation
cpojer
requested changes
Nov 18, 2026
cpojer
left a comment
Member
There was a problem hiding this comment.
The TypeScript case looks good now and routeUrl() still works. The JavaScript behavior worries me though. Can we make .mjs and ESM .js use the same alias resolution as .ts, including for await import()?
Right now, with the same import and tsconfig, seed.ts seeds from the local fixture, but seed.mjs seeds from node_modules if there’s a package with the same name. Changing the file extension shouldn’t change what data ends up in the database.
One smaller thing: a seed that doesn’t use aliases used to work before void prepare. Now it fails if .void/tsconfig.json is missing. Can we update it so the error tells people to run void prepare?
This branch has not been deployed
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.
void db seednow resolves seed and schema imports using the application's tsconfig paths, including@auth-schemareferences used by foreign keys.Build a runtime path map with
get-tsconfig, excluding.d.ts,.d.mts, and.d.ctstargets while preserving inheritance, base URLs, wildcards, and fallback targets. This prevents generated aliases such asvoid/routesfrom replacing runtime helpers with declarations. Jiti receives a temporary config that remains available through seed execution and is removed afterwards.Regression coverage exercises auth foreign keys, schema files and directories, generated declaration aliases with
routeUrl(), mixed declaration/runtime targets, dynamic imports, and CommonJS JavaScript seeds. The seeding guide documents alias support.Closes #872.
Validation:
vp run build:all,vp check,vp run check:types, and build-artifact checksvp run test --listandvp run testvp test run: 827 files and 17,827 tests passed; 1 file and 39 tests skippedvoid preparefollowed by a SQLite seed using generated aliases,routeUrl(), and a dynamic@schemaimport