fix(seed): use tsconfig.app.json instead of inline --compiler-options #235

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

1 Commits

Author SHA1 Message Date
Julien Gautier 9e92fdd820 fix(seed): use tsconfig.app.json instead of inline --compiler-options
CI / check (pull_request) Successful in 1m46s
CI / scan (pull_request) Successful in 4m55s
CI / commits (pull_request) Successful in 6m28s
CI / a11y (pull_request) Successful in 7m36s
Docs site / build (pull_request) Successful in 6m36s
CI / perf (pull_request) Successful in 13m46s
The inline --compiler-options '{"module":"CommonJS",...}' was being
unquoted by the shell when pnpm run db:seed re-spawned ts-node:

  > ts-node --compiler-options {module:CommonJS,esModuleInterop:true,...}

  SyntaxError: Expected property name or '}' in JSON at position 1

Cross-platform quoting of JSON-on-cmdline is a notorious pain.
apps/portal-bff/tsconfig.app.json already declares all the options
we need (module=commonjs, esModuleInterop=true, target=es2021,
moduleResolution=node, types=[node]). Point ts-node at it with -P
and drop the inline JSON entirely.

ts-node --transpile-only ignores the tsconfig's `include`/`exclude`
fields for the file passed explicitly, so the fact that seed.ts is
under prisma/ (not src/) doesn't matter.
2026-05-26 14:50:04 +02:00