### Bug description
Generated TypeScript can be invalid in templates emitted by Stackpress.
### Reproduction
1. Generate client/schema code from `templates/blog` (or a similar flow).
2. Inspect generated file:
- `templates/blog/node_modules/blog-client/Profile/columns/AddressColumn.ts`
3. Formatting/build step fails with:
```txt
SyntaxError: Expression expected. (23:26)
... this._fieldset = new );
Actual behavior
Prettier/parser throws:
SyntaxError: Expression expected. (23:26)
21 | public constructor() {
22 |
> 23 | this._fieldset = new );
| ^
24 | this.shape = this._fieldset.shape.refine(
Expected behavior
Generated constructor call should include a class and optional argument only when present:
this._fieldset = new AddressSchema(seed);
this._fieldset = new AddressSchema();
Root cause hypothesis
The template output for constructor creation appears to be generated with a nested optional block, which can produce an empty argument list and emit invalid TS (new );).
Suggested fix
- Prefer passing
seed as a direct template value in this path instead of using nested conditional tags inside new (...).
- Or harden the template parser to avoid token parsing where
method/name and close patterns consume reserved markers like %, <, and >.
Environment
- Repository:
stackpress-lib
- Path:
/Users/cnc/Projects/stackpress-lib/stackpress
- Error location:
templates/blog/node_modules/blog-client/Profile/columns/AddressColumn.ts line 23
Relevant error snippet
SyntaxError: Expression expected. (23:26)
23 | this._fieldset = new );
| ^
Actual behavior
Prettier/parser throws:
SyntaxError: Expression expected. (23:26) 21 | public constructor() { 22 | > 23 | this._fieldset = new ); | ^ 24 | this.shape = this._fieldset.shape.refine(Expected behavior
Generated constructor call should include a class and optional argument only when present:
this._fieldset = new AddressSchema(seed);this._fieldset = new AddressSchema();Root cause hypothesis
The template output for constructor creation appears to be generated with a nested optional block, which can produce an empty argument list and emit invalid TS (
new );).Suggested fix
seedas a direct template value in this path instead of using nested conditional tags insidenew (...).method/nameand close patterns consume reserved markers like%,<, and>.Environment
stackpress-lib/Users/cnc/Projects/stackpress-lib/stackpresstemplates/blog/node_modules/blog-client/Profile/columns/AddressColumn.tsline 23Relevant error snippet
SyntaxError: Expression expected. (23:26) 23 | this._fieldset = new ); | ^