fix(seed): route prisma db seed through pnpm run for cwd resolution #234

Merged
julien merged 1 commits from fix/prisma-seed-cwd into main 2026-05-26 14:45:16 +02:00

1 Commits

Author SHA1 Message Date
Julien Gautier 54499d6f64 fix(seed): route prisma db seed through pnpm run for cwd resolution
CI / check (pull_request) Successful in 1m53s
CI / commits (pull_request) Successful in 4m12s
CI / scan (pull_request) Successful in 5m9s
CI / a11y (pull_request) Successful in 3m37s
Docs site / build (pull_request) Successful in 3m49s
CI / perf (pull_request) Successful in 9m9s
prisma db seed failed with "Cannot find module './seed.ts'" because
the spawned ts-node command inherited the user's cwd (apps/portal-bff/)
and resolved apps/portal-bff/prisma/seed.ts to
apps/portal-bff/apps/portal-bff/prisma/seed.ts (doubled).

pnpm run resets cwd to the package's root (workspace root) before
running the script. Routing prisma.seed through pnpm run db:seed
makes the path resolution cwd-invariant - works the same whether the
user invokes from the workspace root or from apps/portal-bff/.

Two-line diff: new db:seed script + prisma.seed delegates to it.
Side benefit: pnpm db:seed is directly callable.
2026-05-26 14:42:58 +02:00