Fixed generate-data CLI failing to load TypeScript modules#28413
Conversation
ref #28388 - the topological-sort utility was converted to TypeScript in #28388, but the generate-data/repl/timetravel CLI commands run via bare `node index.js`, which has no TS resolution (unlike `pnpm dev`'s nodemon --import=tsx or the production tsc build) - this broke `pnpm reset:data` with "Cannot find module './utils/topological-sort'" - registering the tsx CommonJS loader at the CLI dispatch point lets these dev-only commands require .ts files regardless of how they are invoked
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis change adds a single-line require statement to register the tsx CommonJS loader at the top of 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
pnpm reset:databroke after #28388 converted the topological-sort seeder utility to TypeScript.The
generate-data/repl/timetravelCLI commands run via barenode index.js, which has no TypeScript resolution — unlikepnpm dev(nodemon--import=tsx) or the production build (tsc). Sorequire('./utils/topological-sort')failed withCannot find module.These commands are dev/local-only, where tsx is always installed. Registering the tsx CommonJS loader at the CLI dispatch point lets them require
.tsfiles regardless of how they're invoked, covering all threereset:data*scripts and the VS Code task.