Skip to content

Commit

Permalink
fix: use shared scaffolder funcs (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman authored Jan 10, 2024
1 parent 7cf01ee commit c218e80
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions cmd/ftl/cmd_schema_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"connectrpc.com/connect"
"github.com/TBD54566975/scaffolder"
"github.com/TBD54566975/scaffolder/extensions/javascript"
"github.com/iancoleman/strcase"
"github.com/radovskyb/watcher"
"golang.org/x/exp/maps"
"golang.org/x/sync/errgroup"
Expand Down Expand Up @@ -138,17 +137,7 @@ func (s *schemaGenerateCmd) regenerateModules(logger *log.Logger, modules []*sch

for _, module := range modules {
if err := scaffolder.Scaffold(s.Template, s.Dest, module,
scaffolder.Functions(scaffolder.FuncMap{
"snake": strcase.ToSnake,
"screamingSnake": strcase.ToScreamingSnake,
"camel": strcase.ToCamel,
"lowerCamel": strcase.ToLowerCamel,
"kebab": strcase.ToKebab,
"screamingKebab": strcase.ToScreamingKebab,
"upper": strings.ToUpper,
"lower": strings.ToLower,
"title": strings.Title,
}),
scaffolder.Functions(scaffoldFuncs),
scaffolder.Extend(javascript.Extension("template.js", javascript.WithLogger(makeJSLoggerAdapter(logger)))),
); err != nil {
return err
Expand Down

0 comments on commit c218e80

Please sign in to comment.