Commit 1bde775
fix: robust schema resolution in Trigger.dev Prisma extension (#2442)
Replace naive path list with a 3-strategy fallback approach:
1. Node module resolution via require.resolve (follows workspace symlinks)
2. Walk up node_modules hierarchy from workingDir and workspaceDir
3. Relative monorepo paths as last resort
Each strategy checks both dist/schema.prisma (combined, from npm) and
prisma/schema/schema.prisma (source, in monorepo workspace).
Fixes: Trigger.dev deploy fails because combine-schemas.js is not part
of packages/db build, so dist/schema.prisma never exists in CI.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 2fdac4c commit 1bde775
2 files changed
Lines changed: 68 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
291 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
292 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
293 | 311 | | |
294 | 312 | | |
295 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
296 | 316 | | |
297 | | - | |
298 | | - | |
299 | | - | |
| 317 | + | |
300 | 318 | | |
301 | 319 | | |
302 | 320 | | |
303 | | - | |
304 | 321 | | |
305 | 322 | | |
306 | 323 | | |
307 | | - | |
308 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
309 | 330 | | |
310 | | - | |
| 331 | + | |
311 | 332 | | |
312 | 333 | | |
313 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
291 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
292 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
293 | 311 | | |
294 | 312 | | |
295 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
296 | 316 | | |
297 | | - | |
298 | | - | |
299 | | - | |
| 317 | + | |
300 | 318 | | |
301 | 319 | | |
302 | 320 | | |
303 | | - | |
304 | 321 | | |
305 | 322 | | |
306 | 323 | | |
307 | | - | |
308 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
309 | 330 | | |
310 | | - | |
| 331 | + | |
311 | 332 | | |
312 | 333 | | |
0 commit comments