Skip to content

Commit

Permalink
separating workflow settings and page sttings
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyk committed Nov 15, 2024
1 parent ffeaa4f commit 313c444
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 6 additions & 4 deletions projectBundler/projectBundler.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,19 @@ func (*KindeProject[TWorkflowSettings, TPageSettings]) readProjectConfiguration(

func (kw *KindeWorkflow[TSettings]) bundleAndIntrospect(ctx context.Context) {
workflowBuilder := bundler.NewWorkflowBundler(bundler.BundlerOptions[TSettings]{
WorkingFolder: kw.WorkflowRootDirectory,
EntryPoints: kw.EntryPoints,
WorkingFolder: kw.WorkflowRootDirectory,
EntryPoints: kw.EntryPoints,
IntrospectionExport: "workflowSettings",
})
bundlerResult := workflowBuilder.Bundle(ctx)
kw.Bundle = bundlerResult
}

func (kw *KindePage[TSettings]) bundleAndIntrospect(ctx context.Context) {
workflowBuilder := bundler.NewWorkflowBundler(bundler.BundlerOptions[TSettings]{
WorkingFolder: kw.RootDirectory,
EntryPoints: kw.EntryPoints,
WorkingFolder: kw.RootDirectory,
EntryPoints: kw.EntryPoints,
IntrospectionExport: "pageSettings",
})
bundlerResult := workflowBuilder.Bundle(ctx)
kw.Bundle = bundlerResult
Expand Down
3 changes: 0 additions & 3 deletions workflowBundler/workflowBundler.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ type (
)

func NewWorkflowBundler[TSettings any](options BundlerOptions[TSettings]) WorkflowBundler[TSettings] {
if options.IntrospectionExport == "" {
options.IntrospectionExport = "workflowSettings"
}
return &builder[TSettings]{
bundleOptions: options,
}
Expand Down
5 changes: 3 additions & 2 deletions workflowBundler/workflowBundler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ func Test_WorkflowBundler(t *testing.T) {
pluginSetupWasCalled := false

workflowBuilder := NewWorkflowBundler[workflowSettings](BundlerOptions[workflowSettings]{
WorkingFolder: workflowPath,
EntryPoints: []string{"tokensWorkflow.ts"},
WorkingFolder: workflowPath,
EntryPoints: []string{"tokensWorkflow.ts"},
IntrospectionExport: "workflowSettings",
OnDiscovered: func(bundle *BundlerResult[workflowSettings]) {
bundle.Errors = append(bundle.Errors, "ID is required")
},
Expand Down

0 comments on commit 313c444

Please sign in to comment.