blitz-js / blitz-js/blitz

`blitz generate page …` creates file with raw comment

Open
#4,223 4 comments 0 reactions 0 assignees View on GitHub
kind/bad-experience scope/generator status/ready-to-work-on
Dominant language
TypeScript
Stars
14.1k
Forks
803
PR merge metrics
No merged PRs in 30d

Description

### What is the problem?

A newly generated template looks like this …

```
export function RegionForm>(props: FormProps) {
return (
{...props}>

{/* template: <__component__ name="__fieldName__" label="__Field_Name__" placeholder="__Field_Name__" type="__inputType__" /> */}

);
}
```

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?

1. `blitz generate all region slug:string:unique shortName:string name:string public:boolean=false`
2. Open the file `src/regions/components/RegionForm.tsx`

### Run `blitz -v` and paste the output here:

```
Blitz version: 2.0.0-beta.33 (global)
Blitz version: 2.0.0-beta.33 (local)
macOS Ventura | darwin-arm64 | Node: v18.16.1

Package manager: npm

System:
OS: macOS 13.6
CPU: (8) arm64 Apple M1
Memory: 106.03 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
Yarn: Not Found
npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm
npmPackages:
@blitzjs/auth: 2.0.0-beta.33 => 2.0.0-beta.33
@blitzjs/next: 2.0.0-beta.33 => 2.0.0-beta.33
@blitzjs/rpc: 2.0.0-beta.33 => 2.0.0-beta.33
@prisma/client: 5.2.0 => 5.2.0
blitz: 2.0.0-beta.33 => 2.0.0-beta.33
next: 13.4.5 => 13.4.5
prisma: 5.2.0 => 5.2.0
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
typescript: ^4.8.4 => 4.9.5
```

### Please include below any other applicable logs and screenshots that show your problem:

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.