diff --git a/generator/src/generate-template-module-connector.js b/generator/src/generate-template-module-connector.js index 0ac6de74..2e8d28d0 100644 --- a/generator/src/generate-template-module-connector.js +++ b/generator/src/generate-template-module-connector.js @@ -29,23 +29,18 @@ type alias Model = type TemplateModel - = ModelBlogPost Template.BlogPost.Model - | ModelShowcase Template.Showcase.Model - | ModelPage Template.Page.Model - | ModelDocumentation Template.Documentation.Model - | ModelBlogIndex Template.BlogIndex.Model + = ${templates.map(name => `Model${name} Template.${name}.Model\n`).join(" | ")} type Msg - = MsgBlogPost Template.BlogPost.Msg - | MsgBlogIndex Template.BlogIndex.Msg - | MsgGlobal Global.Msg + = MsgGlobal Global.Msg | OnPageChange { path : PagePath Pages.PathKey , query : Maybe String , fragment : Maybe String , metadata : Metadata } + | ${templates.map(name => `Msg${name} Template.${name}.Msg\n`).join(" | ")} type alias View = diff --git a/tests/__snapshots__/generated-files.test.js.snap b/tests/__snapshots__/generated-files.test.js.snap index 36de2967..a6a7acfc 100644 --- a/tests/__snapshots__/generated-files.test.js.snap +++ b/tests/__snapshots__/generated-files.test.js.snap @@ -143,23 +143,28 @@ type alias Model = type TemplateModel - = ModelBlogPost Template.BlogPost.Model - | ModelShowcase Template.Showcase.Model - | ModelPage Template.Page.Model + = ModelBlogIndex Template.BlogIndex.Model + | ModelBlogPost Template.BlogPost.Model | ModelDocumentation Template.Documentation.Model - | ModelBlogIndex Template.BlogIndex.Model + | ModelPage Template.Page.Model + | ModelShowcase Template.Showcase.Model + type Msg - = MsgBlogPost Template.BlogPost.Msg - | MsgBlogIndex Template.BlogIndex.Msg - | MsgGlobal Global.Msg + = MsgGlobal Global.Msg | OnPageChange { path : PagePath Pages.PathKey , query : Maybe String , fragment : Maybe String , metadata : Metadata } + | MsgBlogIndex Template.BlogIndex.Msg + | MsgBlogPost Template.BlogPost.Msg + | MsgDocumentation Template.Documentation.Msg + | MsgPage Template.Page.Msg + | MsgShowcase Template.Showcase.Msg + type alias View =