BlitzCliConfig does not work when blitz-server.ts is in /src/app directory
ReadB opened this issue · comments
Ben Read commented
What is the problem?
blitz-server.ts
was moved from src/blitz-server.ts
to src/app/blitz-server.ts
some time between 2.0.0-beta.35 and v2.0.2
This causes the BlitzCliConfig to not function, tested using blitz generate
command and codegen: { fieldTypeMap: {} }
config.
Paste all your error logs here:
n/a
Paste all relevant code snippets here:
blitz-server.ts
import type { BlitzCliConfig } from "blitz"
///...
export const cliConfig: BlitzCliConfig = {
codegen: {
fieldTypeMap: {
string: {
component: "LabeledTextField",
inputType: "text",
zodType: "string",
prismaType: "String",
},
boolean: {
component: "LabeledBooleanField",
inputType: "checkbox",
zodType: "boolean",
prismaType: "Boolean",
},
},
},
}
What are detailed steps to reproduce this?
- Run
blitz new app
- Run
cd app
- Modify the BlitzCliConfig in
src/app/blitz-server.ts
as above - Run
blitz generate all test somestring:string someboolean:boolean
- Find
src/app/tests/components/TestForm.tsx
and observe the field someboolean is using the default LabeledTextField component instead of LabeledBooleanField
Moving src/app/blitz-server.ts
back to the original src/blitz-server.ts
location resolves the issue.
Run blitz -v
and paste the output here:
Blitz version: 2.0.2 (global)
Blitz version: 2.0.2 (local)
Linux 5.19 | linux-x64 | Node: v18.18.2
Package manager: npm
System:
OS: Linux 5.19 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
Memory: 8.99 GB / 15.50 GB
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.18.2/bin/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
npmPackages:
@blitzjs/auth: 2.0.2 => 2.0.2
@blitzjs/next: 2.0.2 => 2.0.2
@blitzjs/rpc: 2.0.2 => 2.0.2
@prisma/client: 5.4.2 => 5.4.2
blitz: 2.0.2 => 2.0.2
next: 13.5.4 => 13.5.4
prisma: 5.4.2 => 5.4.2
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
typescript: 4.8.4 => 4.8.4
Please include below any other applicable logs and screenshots that show your problem:
No response
Siddharth Suresh commented
Thanks for the issue @ReadB! will be fixed in the upcoming patch