diff --git a/backend/schema/module.go b/backend/schema/module.go index fa039869d4..0e76bc01e9 100644 --- a/backend/schema/module.go +++ b/backend/schema/module.go @@ -90,9 +90,7 @@ func (m *Module) String() string { reflect.TypeOf(&Database{}): {gapWithinType: false}, reflect.TypeOf(&Topic{}): {gapWithinType: false}, reflect.TypeOf(&Subscription{}): {gapWithinType: false, skipGapAfterTypes: []reflect.Type{reflect.TypeOf(&Topic{})}}, - reflect.TypeOf(&Enum{}): {gapWithinType: true}, - reflect.TypeOf(&Data{}): {gapWithinType: true}, - reflect.TypeOf(&Verb{}): {gapWithinType: true}, + reflect.TypeOf(&TypeAlias{}): {gapWithinType: false}, } lastTypePrinted := optional.None[reflect.Type]() diff --git a/frontend/console/src/features/modules/schema/schema.utils.ts b/frontend/console/src/features/modules/schema/schema.utils.ts index d818c513c9..343efa2bd5 100644 --- a/frontend/console/src/features/modules/schema/schema.utils.ts +++ b/frontend/console/src/features/modules/schema/schema.utils.ts @@ -38,7 +38,7 @@ export const declTypeMultiselectOpts = [ }, { key: 'secret', - displayName: 'FSM', + displayName: 'Secret', }, { key: 'subscription', @@ -51,7 +51,7 @@ export const declTypeMultiselectOpts = [ ] // Keep these in sync with backend/schema/module.go#L86-L95 -const skipNewLineDeclTypes = ['config', 'secret', 'database', 'topic', 'subscription'] +const skipNewLineDeclTypes = ['config', 'secret', 'database', 'topic', 'subscription', 'typealias'] const skipGapAfterTypes: { [key: string]: string[] } = { secret: ['config'], subscription: ['topic'], diff --git a/go-runtime/schema/schema_fuzz_test.go b/go-runtime/schema/schema_fuzz_test.go index 7283d5aac3..9f1cf007e6 100644 --- a/go-runtime/schema/schema_fuzz_test.go +++ b/go-runtime/schema/schema_fuzz_test.go @@ -339,11 +339,8 @@ module test { subscription subscription test.topic typealias Alias {{.TypeName}} - typealias EqualAlias {{.TypeName}} - export typealias ExportedAlias {{.TypeName}} - export typealias ExportedEqualAlias {{.TypeName}} {{.ValueEnum}}{{.TypeEnum}} data Data { diff --git a/go-runtime/schema/schema_test.go b/go-runtime/schema/schema_test.go index 0b910ba9c6..65203b3091 100644 --- a/go-runtime/schema/schema_test.go +++ b/go-runtime/schema/schema_test.go @@ -197,20 +197,15 @@ func TestExtractModuleSchemaTwo(t *testing.T) { expected := `module two { typealias BackoffAlias Any +typemap go "github.com/jpillora/backoff.Backoff" - typealias ExplicitAliasAlias Any +typemap kotlin "com.foo.bar.NonFTLType" +typemap go "github.com/TBD54566975/ftl/go-runtime/schema/testdata.lib.NonFTLType" - typealias ExplicitAliasType Any +typemap kotlin "com.foo.bar.NonFTLType" +typemap go "github.com/TBD54566975/ftl/go-runtime/schema/testdata.lib.NonFTLType" - typealias PaymentState String - typealias TransitiveAliasAlias Any +typemap go "github.com/TBD54566975/ftl/go-runtime/schema/testdata.lib.NonFTLType" - typealias TransitiveAliasType Any +typemap go "github.com/TBD54566975/ftl/go-runtime/schema/testdata.lib.NonFTLType" @@ -356,12 +351,9 @@ func TestExtractModuleSchemaNamedTypes(t *testing.T) { actual := schema.Normalise(r.Module) expected := `module named { typealias DoubleAliasedUser named.InternalUser - // ID testing if typealias before struct works export typealias Id String - typealias InternalUser named.User - // Name testing if typealias after struct works export typealias Name String