Skip to content

Commit

Permalink
[Internal] Move templates in the code generator (#1075)
Browse files Browse the repository at this point in the history
## Changes
<!-- Summary of your changes that are easy to understand -->
Move templates in the code generator.

## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->
The generator is working correctly with the new configuration.
  • Loading branch information
parthban-db authored Oct 29, 2024
1 parent e873ca2 commit e338159
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 1,165 deletions.
22 changes: 2 additions & 20 deletions .codegen.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
{
"formatter": "go fmt ./... && go run golang.org/x/tools/cmd/goimports@latest -w $FILENAMES",
"mode": "go_v0",
"changelog_config": ".codegen/changelog_config.yml",
"packages": {
".codegen/api.go.tmpl": "service/{{.Name}}/api.go",
".codegen/impl.go.tmpl": "service/{{.Name}}/impl.go",
".codegen/interface.go.tmpl": "service/{{.Name}}/interface.go",
".codegen/model.go.tmpl": "service/{{.Name}}/model.go"
},
"batch": {
".codegen/workspaces.go.tmpl": "workspace_client.go",
".codegen/accounts.go.tmpl": "account_client.go",
".codegen/service-pkg.go.tmpl": "service/pkg.go",
".codegen/error_mapping.go.tmpl": "apierr/error_mapping.go",
".codegen/error_overrides.go.tmpl": "apierr/error_overrides.go",
".codegen/error_alias.go.tmpl": "error_alias.go",
".codegen/mock_workspace_client.go.tmpl": "experimental/mocks/mock_workspace_client.go",
".codegen/mock_account_client.go.tmpl": "experimental/mocks/mock_account_client.go"
},
"examples": {
".codegen/examples_test.go.tmpl": "service/{{.Package}}/{{.SnakeName}}_usage_test.go"
},
"version": {
"version/version.go": "const Version = \"$VERSION\""
},
Expand All @@ -28,6 +9,7 @@
"go"
],
"post_generate": [
"make fmt",
"go run github.com/vektra/mockery/v2@0229bd4bb4357cd09af7ac15ecab85022d296b12"
]
}
Expand Down
62 changes: 0 additions & 62 deletions .codegen/accounts.go.tmpl

This file was deleted.

Loading

0 comments on commit e338159

Please sign in to comment.