Open tordans opened 1 year ago
Addition:
Same issue on the Schema (eg src/regions/schemas.ts
), which says // template: __fieldName__: z.__zodType__(),
Hey @tordans it's meant to be there, the generator uses those comments to know where to update the file, if you choose to run the generate command again on the same modal with new fields.
@siddhsuresh oh, I see. Did not understand it as such. Can this be any text? Or could we prefix it with a more descriptive line? "Keep the following line so blitz generate
can update the form later."
Hey @tordans We could improve this comment, we just use regex matching to find this and replace. Would you be interested in working on this?
What is the problem?
A newly generated template looks like this …
The part
{/* template: <__component__ name="__fieldName__" label="__Field_Name__" placeholder="__Field_Name__" type="__inputType__" /> */}
should either be transformed … or not be there.It looks like this is the comment that is visible here https://github.com/blitz-js/blitz/blob/main/packages/generator/templates/form/__ModelName__Form.tsx#L11
Paste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
blitz generate all region slug:string:unique shortName:string name:string public:boolean=false
src/regions/components/RegionForm.tsx
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response