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
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.
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@
|
||||
"docs:dev": "vitepress dev docs",
|
||||
"docs:build": "vitepress build docs",
|
||||
"docs:preview": "vitepress preview docs",
|
||||
"db:seed": "ts-node --transpile-only --compiler-options {\"module\":\"CommonJS\",\"esModuleInterop\":true,\"target\":\"ES2020\"} apps/portal-bff/prisma/seed.ts"
|
||||
"db:seed": "ts-node --transpile-only -P apps/portal-bff/tsconfig.app.json apps/portal-bff/prisma/seed.ts"
|
||||
},
|
||||
"private": true,
|
||||
"lint-staged": {
|
||||
|
||||
Reference in New Issue
Block a user