Skip to content

Commit

Permalink
Remove codegen for BFF (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
geel9 authored Aug 3, 2023
1 parent 7cbad1d commit bc91969
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 43 deletions.
5 changes: 1 addition & 4 deletions action.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ param(

[Parameter()][string]$DocsPath,

[Parameter()][string]$DashboardBffPath,
[Parameter()][string]$DashboardFrontendPath,

[Parameter()][string]$BuildTarget = "sdk"
Expand All @@ -29,7 +28,6 @@ $JavaKotlinPath = (Resolve-Path $JavaKotlinPath)?.Path?.Replace(":","?") ?? "***
$RubyPath = "***SKIP***"
$SwiftPath = (Resolve-Path $SwiftPath)?.Path?.Replace(":","?") ?? "***SKIP***"

$DashboardBffPath = (Resolve-Path $DashboardBffPath)?.Path?.Replace(":","?") ?? "***SKIP***"
$DashboardFrontendPath = (Resolve-Path $DashboardFrontendPath)?.Path?.Replace(":","?") ?? "***SKIP***"
$DocsPath = (Resolve-Path $DocsPath)?.Path?.Replace(":","?") ?? "***SKIP***"

Expand All @@ -44,7 +42,6 @@ $SwiftArg = "swift_path=${SwiftPath}"

$DocsArg = "docs_path=${DocsPath}"

$DashboardBffArg = "dashboardbff_path=${DashboardBffPath}"
$DashboardFrontendArg = "dashboardfrontend_path=${DashboardFrontendPath}"

$BuildTargetArg = "build_target=${BuildTarget}"
Expand Down Expand Up @@ -75,7 +72,7 @@ Else
foreach ($Item in Get-ChildItem -Path $ProtoPath -Include *.proto -Recurse)
{
$File = $Item.FullName
$Expr = "protoc --plugin=protoc-gen-trinsic-sdk=${PluginPath} --trinsic-sdk_out=${BuildTargetArg},${RenamePairs},${DartArg},${PythonArg},${GolangArg},${TypescriptArg},${DotnetArg},${JavaKotlinArg},${RubyArg},${SwiftArg},${DashboardBffArg},${DashboardFrontendArg},${DocsArg}: -I $ProtoPath $File"
$Expr = "protoc --plugin=protoc-gen-trinsic-sdk=${PluginPath} --trinsic-sdk_out=${BuildTargetArg},${RenamePairs},${DartArg},${PythonArg},${GolangArg},${TypescriptArg},${DotnetArg},${JavaKotlinArg},${RubyArg},${SwiftArg},${DashboardFrontendArg},${DocsArg}: -I $ProtoPath $File"
# Write-Output $Expr
Invoke-Expression $Expr
}
Expand Down
5 changes: 0 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ inputs:
description: 'path for swift output'
required: false
default: '***SKIP***'
dashboardBffPath:
description: 'path for .NET BFF output'
required: false
default: '***SKIP***'
dashboardFrontendPath:
description: 'path for typescript dashboard output'
required: false
Expand Down Expand Up @@ -69,7 +65,6 @@ runs:
-TypescriptPath "${{ inputs.typescriptPath }}" `
-JavaKotlinPath "${{ inputs.javaKotlinPath }}" `
-SwiftPath "${{ inputs.swiftPath }}" `
-DashboardBffPath "${{ inputs.dashboardBffPath }}" `
-DashboardFrontendPath "${{ inputs.dashboardFrontendPath }}"`
-DocsPath "***SKIP***"
shell: pwsh
3 changes: 0 additions & 3 deletions build_test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ $RenamePairs = "trust-registry=trustregistry,universal-wallet=wallet,verifiable-
# Default to doing nothing
$PythonPath = "***SKIP***"
$DotnetPath = "***SKIP***"
$DashboardBffPath = "***SKIP***"
$DashboardFrontendPath = "***SKIP***"
$DartPath = "***SKIP***"
$GolangPath = "***SKIP***"
Expand All @@ -63,7 +62,6 @@ if ($BuildTarget -eq "sdk-swift" -or $BuildTarget -eq "docs")
if ($BuildTarget -eq "server")
{
$ProtoPath = "$PSScriptRoot/../server/proto"
$DashboardBffPath = "$PSScriptRoot/../server/dashboard/service/Dashboard/Services"
$DashboardFrontendPath = "$PSScriptRoot/../server/dashboard/app/src/services/Trinsic"
$DocsPath = "***SKIP***"
}
Expand All @@ -73,7 +71,6 @@ if ($BuildTarget -eq "server")
-RenamePairs $RenamePairs `
-PythonPath $PythonPath `
-DotnetPath $DotnetPath `
-DashboardBffPath $DashboardBffPath `
-DashboardFrontendPath $DashboardFrontendPath `
-DartPath $DartPath `
-GolangPath $GolangPath `
Expand Down
12 changes: 0 additions & 12 deletions generator_targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,6 @@ func TrinsicSwift() *tpp.TrinsicModule {
}
}

func TrinsicDashboardBff() *tpp.TrinsicModule {
funcs := lang_types.GetTemplateFuncs()
return &tpp.TrinsicModule{
ModuleBase: &pgs.ModuleBase{},
ServiceTpl: template.Must(template.New("dashboardBffService").Funcs(funcs).Parse(lang_types.DashboardBFFServiceTpl)),
FileCase: pgs.Name.UpperCamelCase,
FileExt: "cs",
TargetName: "dashboardbff_path",
ServiceFileSuffix: "Service",
}
}

func TrinsicDashboardFrontend() *tpp.TrinsicModule {
funcs := lang_types.GetTemplateFuncs()
return &tpp.TrinsicModule{
Expand Down
17 changes: 0 additions & 17 deletions lang_types/dashboard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ import (
"strings"
)

func DashboardBffMethodArguments(method pgs.Method) string {
if SdkNoArguments(method) {
return ""
} else {
return fmt.Sprintf("%s.Parser.ParseFrom(request.Data)", DotnetMethodParamType(method))
}
}

func DashboardFrontendClassDefinition(method pgs.Method) string {
return fmt.Sprintf("%sDefinition", method.Service().Name().UpperCamelCase())
}
Expand Down Expand Up @@ -99,15 +91,6 @@ func getTypescriptProtoType(myType pgs.FieldType) string {
//return "proto." + typeParts[len(typeParts)-1] + " | undefined"
}

const DashboardBFFServiceTpl = `// BEGIN Code generated by protoc-gen-trinsic. DO NOT EDIT.
// target: {{ .TargetPath }}
{{ range .File.Services }}{{ range .Methods }}{{ if SdkTemplateGenerate . }}
case nameof(service.{{ .Name.UpperCamelCase }}):
response = await service.{{ .Name.UpperCamelCase }}Async({{ DashboardBffMethodArguments .}});
break;
{{ end }}{{ end }}{{ end }}
// END Code generated by protoc-gen-trinsic. DO NOT EDIT.`

const DashboardFrontendServiceTpl = `// BEGIN Code generated by protoc-gen-trinsic. DO NOT EDIT.
// target: {{ .TargetPath }}
{{ range .File.Services }}{{ range .Methods }}{{ if SdkTemplateGenerate . }}
Expand Down
1 change: 0 additions & 1 deletion lang_types/function_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func GetTemplateFuncs() map[string]interface{} {
"DotnetDefaultRequestObject": DotnetDefaultRequestObject,
"DotnetAnnotations": DotnetAnnotations,

"DashboardBffMethodArguments": DashboardBffMethodArguments,
"DashboardFrontendClassDefinition": DashboardFrontendClassDefinition,
"DashboardFrontendServicePath": DashboardFrontendServicePath,
"DashboardFrontendMethodReturnType": DashboardFrontendMethodReturnType,
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ func main() {
pgs.Init(pgs.DebugMode(), pgs.SupportedFeatures(&supportOptional)).
RegisterModule(TrinsicDart()).
RegisterModule(TrinsicDotnet()).
RegisterModule(TrinsicDashboardBff()).
RegisterModule(TrinsicDashboardFrontend()).
RegisterModule(TrinsicGolangInterface()).
RegisterModule(TrinsicGolangImplementation()).
Expand Down

0 comments on commit bc91969

Please sign in to comment.