Skip to content

Commit

Permalink
TS Resource Jenny: don't generate files if codegen.frontend is false.
Browse files Browse the repository at this point in the history
  • Loading branch information
IfSentient committed Mar 18, 2024
1 parent 3c3be6e commit 66c96ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions codegen/jennies/typescript.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ func (t *TypeScriptResourceTypes) Generate(kind codegen.Kind) (codejen.Files, er
if ver == nil {
return nil, fmt.Errorf("no version for %s", kind.Properties().Current)
}
if !ver.Codegen.Frontend {
return nil, nil
}
b, err := t.generateObjectFile(kind, ver, strings.ToLower(kind.Properties().MachineName)+"_")
if err != nil {
return nil, err
Expand All @@ -40,6 +43,9 @@ func (t *TypeScriptResourceTypes) Generate(kind codegen.Kind) (codejen.Files, er
allVersions := kind.Versions()
for i := 0; i < len(allVersions); i++ {
ver := allVersions[i]
if !ver.Codegen.Frontend {
continue
}
b, err := t.generateObjectFile(kind, &ver, "")
if err != nil {
return nil, err
Expand Down

0 comments on commit 66c96ee

Please sign in to comment.