diff --git a/build/build.go b/builder/build.go similarity index 96% rename from build/build.go rename to builder/build.go index 10675c60..ae6fea83 100644 --- a/build/build.go +++ b/builder/build.go @@ -9,4 +9,4 @@ database. For example, the "Stream" builder has queries for `Ancestors`, This package also contains implementations for all the action steps available to template designers. */ -package build +package builder diff --git a/build/builder_.go b/builder/builder_.go similarity index 99% rename from build/builder_.go rename to builder/builder_.go index 424327d6..483bf4f9 100644 --- a/build/builder_.go +++ b/builder/builder_.go @@ -1,4 +1,4 @@ -package build +package builder import ( "html/template" diff --git a/build/builder_admin_block.go b/builder/builder_admin_block.go similarity index 99% rename from build/builder_admin_block.go rename to builder/builder_admin_block.go index 3bdeca28..62f778c8 100644 --- a/build/builder_admin_block.go +++ b/builder/builder_admin_block.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/builder_admin_domain.go b/builder/builder_admin_domain.go similarity index 99% rename from build/builder_admin_domain.go rename to builder/builder_admin_domain.go index 63e5ed3c..3761e59d 100644 --- a/build/builder_admin_domain.go +++ b/builder/builder_admin_domain.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/builder_admin_groups.go b/builder/builder_admin_groups.go similarity index 99% rename from build/builder_admin_groups.go rename to builder/builder_admin_groups.go index 0ee4299f..69a08b8a 100644 --- a/build/builder_admin_groups.go +++ b/builder/builder_admin_groups.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/builder_admin_navigation.go b/builder/builder_admin_navigation.go similarity index 99% rename from build/builder_admin_navigation.go rename to builder/builder_admin_navigation.go index 375f734f..cacf1087 100644 --- a/build/builder_admin_navigation.go +++ b/builder/builder_admin_navigation.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/builder_admin_users.go b/builder/builder_admin_users.go similarity index 99% rename from build/builder_admin_users.go rename to builder/builder_admin_users.go index e171d45e..46132894 100644 --- a/build/builder_admin_users.go +++ b/builder/builder_admin_users.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/builder_common.go b/builder/builder_common.go similarity index 99% rename from build/builder_common.go rename to builder/builder_common.go index 4517e06d..f643eded 100644 --- a/build/builder_common.go +++ b/builder/builder_common.go @@ -1,4 +1,4 @@ -package build +package builder import ( "html/template" diff --git a/build/builder_inbox.go b/builder/builder_inbox.go similarity index 99% rename from build/builder_inbox.go rename to builder/builder_inbox.go index b7e265b0..8f2077df 100644 --- a/build/builder_inbox.go +++ b/builder/builder_inbox.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/builder_model.go b/builder/builder_model.go similarity index 99% rename from build/builder_model.go rename to builder/builder_model.go index e494c010..b5c91a3c 100644 --- a/build/builder_model.go +++ b/builder/builder_model.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/builder_oAuthAuthorization.go b/builder/builder_oAuthAuthorization.go similarity index 99% rename from build/builder_oAuthAuthorization.go rename to builder/builder_oAuthAuthorization.go index 8e2604bb..e1671835 100644 --- a/build/builder_oAuthAuthorization.go +++ b/builder/builder_oAuthAuthorization.go @@ -1,4 +1,4 @@ -package build +package builder import ( "strings" diff --git a/build/builder_outbox.go b/builder/builder_outbox.go similarity index 99% rename from build/builder_outbox.go rename to builder/builder_outbox.go index 30d8acd3..183d3f4c 100644 --- a/build/builder_outbox.go +++ b/builder/builder_outbox.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/builder_stream.go b/builder/builder_stream.go similarity index 99% rename from build/builder_stream.go rename to builder/builder_stream.go index 388b10a5..70c1889d 100644 --- a/build/builder_stream.go +++ b/builder/builder_stream.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/builder_widget.go b/builder/builder_widget.go similarity index 96% rename from build/builder_widget.go rename to builder/builder_widget.go index 8b0502c9..54e0e2c0 100644 --- a/build/builder_widget.go +++ b/builder/builder_widget.go @@ -1,4 +1,4 @@ -package build +package builder import ( "github.com/EmissarySocial/emissary/model" diff --git a/build/constants.go b/builder/constants.go similarity index 94% rename from build/constants.go rename to builder/constants.go index 2c5a0009..21fde789 100644 --- a/build/constants.go +++ b/builder/constants.go @@ -1,4 +1,4 @@ -package build +package builder // ActionMethod enumerates the HTTP methods that can be performed on Actions type ActionMethod uint8 diff --git a/build/factory.go b/builder/factory.go similarity index 99% rename from build/factory.go rename to builder/factory.go index 231a96ec..d86b5e15 100644 --- a/build/factory.go +++ b/builder/factory.go @@ -1,4 +1,4 @@ -package build +package builder import ( "github.com/EmissarySocial/emissary/config" diff --git a/build/functions.go b/builder/functions.go similarity index 99% rename from build/functions.go rename to builder/functions.go index 63947c6e..7ae3dbf7 100644 --- a/build/functions.go +++ b/builder/functions.go @@ -1,4 +1,4 @@ -package build +package builder import ( "encoding/json" diff --git a/build/functions_test.go b/builder/functions_test.go similarity index 97% rename from build/functions_test.go rename to builder/functions_test.go index fd5ee717..4fa8c242 100644 --- a/build/functions_test.go +++ b/builder/functions_test.go @@ -1,4 +1,4 @@ -package build +package builder import ( "html/template" diff --git a/build/interfaces.go b/builder/interfaces.go similarity index 95% rename from build/interfaces.go rename to builder/interfaces.go index 44c2507f..7df8174a 100644 --- a/build/interfaces.go +++ b/builder/interfaces.go @@ -1,4 +1,4 @@ -package build +package builder import "github.com/EmissarySocial/emissary/model" diff --git a/build/pipeline.go b/builder/pipeline.go similarity index 98% rename from build/pipeline.go rename to builder/pipeline.go index 349b036c..cf0ee24a 100644 --- a/build/pipeline.go +++ b/builder/pipeline.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/pipeline_behavior.go b/builder/pipeline_behavior.go similarity index 99% rename from build/pipeline_behavior.go rename to builder/pipeline_behavior.go index 6ea4a52b..68901ccd 100644 --- a/build/pipeline_behavior.go +++ b/builder/pipeline_behavior.go @@ -1,4 +1,4 @@ -package build +package builder type PipelineBehavior func(*PipelineResult) diff --git a/build/pipeline_result.go b/builder/pipeline_result.go similarity index 99% rename from build/pipeline_result.go rename to builder/pipeline_result.go index fb1f03b2..010f21e4 100644 --- a/build/pipeline_result.go +++ b/builder/pipeline_result.go @@ -1,4 +1,4 @@ -package build +package builder import ( "encoding/json" diff --git a/build/queryBuilder.go b/builder/queryBuilder.go similarity index 99% rename from build/queryBuilder.go rename to builder/queryBuilder.go index 5b350031..152d621b 100644 --- a/build/queryBuilder.go +++ b/builder/queryBuilder.go @@ -1,4 +1,4 @@ -package build +package builder import ( "github.com/EmissarySocial/emissary/model" diff --git a/build/step_.go b/builder/step_.go similarity index 99% rename from build/step_.go rename to builder/step_.go index ab11bce7..4ad981d0 100644 --- a/build/step_.go +++ b/builder/step_.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_AddModelObject.go b/builder/step_AddModelObject.go similarity index 99% rename from build/step_AddModelObject.go rename to builder/step_AddModelObject.go index ca6949e2..64d3b9b4 100644 --- a/build/step_AddModelObject.go +++ b/builder/step_AddModelObject.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_AddStream.go b/builder/step_AddStream.go similarity index 99% rename from build/step_AddStream.go rename to builder/step_AddStream.go index 506c26e6..4826b8cf 100644 --- a/build/step_AddStream.go +++ b/builder/step_AddStream.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_AsConfirmation.go b/builder/step_AsConfirmation.go similarity index 98% rename from build/step_AsConfirmation.go rename to builder/step_AsConfirmation.go index b845cebf..bde05a9d 100644 --- a/build/step_AsConfirmation.go +++ b/builder/step_AsConfirmation.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_AsModal.go b/builder/step_AsModal.go similarity index 99% rename from build/step_AsModal.go rename to builder/step_AsModal.go index 8dc5132d..63bf87ec 100644 --- a/build/step_AsModal.go +++ b/builder/step_AsModal.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/step_AsTooltip.go b/builder/step_AsTooltip.go similarity index 98% rename from build/step_AsTooltip.go rename to builder/step_AsTooltip.go index 2eb62926..321d2053 100644 --- a/build/step_AsTooltip.go +++ b/builder/step_AsTooltip.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/step_Delete.go b/builder/step_Delete.go similarity index 98% rename from build/step_Delete.go rename to builder/step_Delete.go index e506f274..0ce69b71 100644 --- a/build/step_Delete.go +++ b/builder/step_Delete.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_DeleteAttachments.go b/builder/step_DeleteAttachments.go similarity index 98% rename from build/step_DeleteAttachments.go rename to builder/step_DeleteAttachments.go index 2d7b32b5..eda6031e 100644 --- a/build/step_DeleteAttachments.go +++ b/builder/step_DeleteAttachments.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_EditConnection.go b/builder/step_EditConnection.go similarity index 99% rename from build/step_EditConnection.go rename to builder/step_EditConnection.go index a331aee5..99cea2f2 100644 --- a/build/step_EditConnection.go +++ b/builder/step_EditConnection.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_EditContent.go b/builder/step_EditContent.go similarity index 99% rename from build/step_EditContent.go rename to builder/step_EditContent.go index a1297561..9db115ed 100644 --- a/build/step_EditContent.go +++ b/builder/step_EditContent.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/step_EditModelObject.go b/builder/step_EditModelObject.go similarity index 99% rename from build/step_EditModelObject.go rename to builder/step_EditModelObject.go index 88387f9a..f753e36c 100644 --- a/build/step_EditModelObject.go +++ b/builder/step_EditModelObject.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_EditTable.go b/builder/step_EditTable.go similarity index 99% rename from build/step_EditTable.go rename to builder/step_EditTable.go index 911a97c5..84296dc8 100644 --- a/build/step_EditTable.go +++ b/builder/step_EditTable.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_EditWidget.go b/builder/step_EditWidget.go similarity index 99% rename from build/step_EditWidget.go rename to builder/step_EditWidget.go index 94ebe159..4f2769f8 100644 --- a/build/step_EditWidget.go +++ b/builder/step_EditWidget.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_Error.go b/builder/step_Error.go similarity index 97% rename from build/step_Error.go rename to builder/step_Error.go index acab11a6..abae57e8 100644 --- a/build/step_Error.go +++ b/builder/step_Error.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_ForwardTo.go b/builder/step_ForwardTo.go similarity index 97% rename from build/step_ForwardTo.go rename to builder/step_ForwardTo.go index cd52432a..eb3101dd 100644 --- a/build/step_ForwardTo.go +++ b/builder/step_ForwardTo.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/step_Halt.go b/builder/step_Halt.go similarity index 95% rename from build/step_Halt.go rename to builder/step_Halt.go index c73b3d88..430691c0 100644 --- a/build/step_Halt.go +++ b/builder/step_Halt.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_IfCondition.go b/builder/step_IfCondition.go similarity index 99% rename from build/step_IfCondition.go rename to builder/step_IfCondition.go index a4855005..522fa727 100644 --- a/build/step_IfCondition.go +++ b/builder/step_IfCondition.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/step_InlineError.go b/builder/step_InlineError.go similarity index 97% rename from build/step_InlineError.go rename to builder/step_InlineError.go index 8ff8f83d..fa322cdc 100644 --- a/build/step_InlineError.go +++ b/builder/step_InlineError.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_InlineSuccess.go b/builder/step_InlineSuccess.go similarity index 97% rename from build/step_InlineSuccess.go rename to builder/step_InlineSuccess.go index caaa2789..488a4d77 100644 --- a/build/step_InlineSuccess.go +++ b/builder/step_InlineSuccess.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_ProcessContent.go b/builder/step_ProcessContent.go similarity index 98% rename from build/step_ProcessContent.go rename to builder/step_ProcessContent.go index 65a876cf..d950b479 100644 --- a/build/step_ProcessContent.go +++ b/builder/step_ProcessContent.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_PromoteDraft.go b/builder/step_PromoteDraft.go similarity index 98% rename from build/step_PromoteDraft.go rename to builder/step_PromoteDraft.go index ec9463b2..29a01678 100644 --- a/build/step_PromoteDraft.go +++ b/builder/step_PromoteDraft.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_Publish.go b/builder/step_Publish.go similarity index 98% rename from build/step_Publish.go rename to builder/step_Publish.go index 8cc80f0b..8dbf5032 100644 --- a/build/step_Publish.go +++ b/builder/step_Publish.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_RedirectTo.go b/builder/step_RedirectTo.go similarity index 98% rename from build/step_RedirectTo.go rename to builder/step_RedirectTo.go index 6d7963a9..9fbc7edb 100644 --- a/build/step_RedirectTo.go +++ b/builder/step_RedirectTo.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/step_RefreshPage.go b/builder/step_RefreshPage.go similarity index 96% rename from build/step_RefreshPage.go rename to builder/step_RefreshPage.go index fa5ac99e..236a0d5b 100644 --- a/build/step_RefreshPage.go +++ b/builder/step_RefreshPage.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_ReloadPage.go b/builder/step_ReloadPage.go similarity index 96% rename from build/step_ReloadPage.go rename to builder/step_ReloadPage.go index 7ef58ef9..c9d39336 100644 --- a/build/step_ReloadPage.go +++ b/builder/step_ReloadPage.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_RemoveEvent.go b/builder/step_RemoveEvent.go similarity index 96% rename from build/step_RemoveEvent.go rename to builder/step_RemoveEvent.go index 7feee843..56507072 100644 --- a/build/step_RemoveEvent.go +++ b/builder/step_RemoveEvent.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_Save.go b/builder/step_Save.go similarity index 98% rename from build/step_Save.go rename to builder/step_Save.go index 9a8f9fac..e70f5955 100644 --- a/build/step_Save.go +++ b/builder/step_Save.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SendEmail.go b/builder/step_SendEmail.go similarity index 98% rename from build/step_SendEmail.go rename to builder/step_SendEmail.go index 0e397bdb..d3bc2bca 100644 --- a/build/step_SendEmail.go +++ b/builder/step_SendEmail.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_ServerRedirect.go b/builder/step_ServerRedirect.go similarity index 98% rename from build/step_ServerRedirect.go rename to builder/step_ServerRedirect.go index 59b8377a..43d0d3b7 100644 --- a/build/step_ServerRedirect.go +++ b/builder/step_ServerRedirect.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SetData.go b/builder/step_SetData.go similarity index 99% rename from build/step_SetData.go rename to builder/step_SetData.go index 60415362..b29014a3 100644 --- a/build/step_SetData.go +++ b/builder/step_SetData.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SetHeader.go b/builder/step_SetHeader.go similarity index 98% rename from build/step_SetHeader.go rename to builder/step_SetHeader.go index dc7cd57f..f8ccc3bb 100644 --- a/build/step_SetHeader.go +++ b/builder/step_SetHeader.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/step_SetQueryParam.go b/builder/step_SetQueryParam.go similarity index 98% rename from build/step_SetQueryParam.go rename to builder/step_SetQueryParam.go index ce9a6ed6..b2b55f50 100644 --- a/build/step_SetQueryParam.go +++ b/builder/step_SetQueryParam.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SetRenderData.go b/builder/step_SetRenderData.go similarity index 97% rename from build/step_SetRenderData.go rename to builder/step_SetRenderData.go index 114b7d56..425c9760 100644 --- a/build/step_SetRenderData.go +++ b/builder/step_SetRenderData.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SetResponse.go b/builder/step_SetResponse.go similarity index 99% rename from build/step_SetResponse.go rename to builder/step_SetResponse.go index 63a14ddb..7e714189 100644 --- a/build/step_SetResponse.go +++ b/builder/step_SetResponse.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SetSimpleSharing.go b/builder/step_SetSimpleSharing.go similarity index 99% rename from build/step_SetSimpleSharing.go rename to builder/step_SetSimpleSharing.go index c82ee6aa..ef96a2a0 100644 --- a/build/step_SetSimpleSharing.go +++ b/builder/step_SetSimpleSharing.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SetState.go b/builder/step_SetState.go similarity index 98% rename from build/step_SetState.go rename to builder/step_SetState.go index dac58532..573deb0d 100644 --- a/build/step_SetState.go +++ b/builder/step_SetState.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SetThumbnail.go b/builder/step_SetThumbnail.go similarity index 99% rename from build/step_SetThumbnail.go rename to builder/step_SetThumbnail.go index d3736810..ac40133f 100644 --- a/build/step_SetThumbnail.go +++ b/builder/step_SetThumbnail.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_Sort.go b/builder/step_Sort.go similarity index 99% rename from build/step_Sort.go rename to builder/step_Sort.go index 74ccb240..c7426f25 100644 --- a/build/step_Sort.go +++ b/builder/step_Sort.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SortAttachments.go b/builder/step_SortAttachments.go similarity index 99% rename from build/step_SortAttachments.go rename to builder/step_SortAttachments.go index 999daeca..a915c44b 100644 --- a/build/step_SortAttachments.go +++ b/builder/step_SortAttachments.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_SortWidgets.go b/builder/step_SortWidgets.go similarity index 99% rename from build/step_SortWidgets.go rename to builder/step_SortWidgets.go index aef16dd9..1ae0f9f9 100644 --- a/build/step_SortWidgets.go +++ b/builder/step_SortWidgets.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_TriggerEvent.go b/builder/step_TriggerEvent.go similarity index 97% rename from build/step_TriggerEvent.go rename to builder/step_TriggerEvent.go index 9030986c..d9cb6236 100644 --- a/build/step_TriggerEvent.go +++ b/builder/step_TriggerEvent.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_UnPublish.go b/builder/step_UnPublish.go similarity index 98% rename from build/step_UnPublish.go rename to builder/step_UnPublish.go index 459fcda9..1ed03a68 100644 --- a/build/step_UnPublish.go +++ b/builder/step_UnPublish.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_UploadAttachment.go b/builder/step_UploadAttachment.go similarity index 99% rename from build/step_UploadAttachment.go rename to builder/step_UploadAttachment.go index 10514529..2c30d9ff 100644 --- a/build/step_UploadAttachment.go +++ b/builder/step_UploadAttachment.go @@ -1,4 +1,4 @@ -package build +package builder import ( "encoding/json" diff --git a/build/step_ViewFeed.go b/builder/step_ViewFeed.go similarity index 99% rename from build/step_ViewFeed.go rename to builder/step_ViewFeed.go index 6fb31a1f..8e720d44 100644 --- a/build/step_ViewFeed.go +++ b/builder/step_ViewFeed.go @@ -1,4 +1,4 @@ -package build +package builder import ( "encoding/json" diff --git a/build/step_ViewHTML.go b/builder/step_ViewHTML.go similarity index 99% rename from build/step_ViewHTML.go rename to builder/step_ViewHTML.go index d99a6e15..94b117d0 100644 --- a/build/step_ViewHTML.go +++ b/builder/step_ViewHTML.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_ViewJSONLD.go b/builder/step_ViewJSONLD.go similarity index 99% rename from build/step_ViewJSONLD.go rename to builder/step_ViewJSONLD.go index 209f6344..4ff3828e 100644 --- a/build/step_ViewJSONLD.go +++ b/builder/step_ViewJSONLD.go @@ -1,4 +1,4 @@ -package build +package builder import ( "encoding/json" diff --git a/build/step_WebSub.go b/builder/step_WebSub.go similarity index 99% rename from build/step_WebSub.go rename to builder/step_WebSub.go index 99520786..1adce867 100644 --- a/build/step_WebSub.go +++ b/builder/step_WebSub.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WebSub_test.go b/builder/step_WebSub_test.go similarity index 99% rename from build/step_WebSub_test.go rename to builder/step_WebSub_test.go index f47ddc56..dec10b21 100644 --- a/build/step_WebSub_test.go +++ b/builder/step_WebSub_test.go @@ -1,4 +1,4 @@ -package build +package builder import ( "testing" diff --git a/build/step_WithChildren.go b/builder/step_WithChildren.go similarity index 99% rename from build/step_WithChildren.go rename to builder/step_WithChildren.go index 63ead514..37a695fb 100644 --- a/build/step_WithChildren.go +++ b/builder/step_WithChildren.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithDraft.go b/builder/step_WithDraft.go similarity index 98% rename from build/step_WithDraft.go rename to builder/step_WithDraft.go index b66e9f4a..54197546 100644 --- a/build/step_WithDraft.go +++ b/builder/step_WithDraft.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithFolder.go b/builder/step_WithFolder.go similarity index 99% rename from build/step_WithFolder.go rename to builder/step_WithFolder.go index 09e2a9b2..4167d0d7 100644 --- a/build/step_WithFolder.go +++ b/builder/step_WithFolder.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithFollower.go b/builder/step_WithFollower.go similarity index 99% rename from build/step_WithFollower.go rename to builder/step_WithFollower.go index 736cb129..3aec6713 100644 --- a/build/step_WithFollower.go +++ b/builder/step_WithFollower.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithFollowing.go b/builder/step_WithFollowing.go similarity index 99% rename from build/step_WithFollowing.go rename to builder/step_WithFollowing.go index 4c35c952..faba5c57 100644 --- a/build/step_WithFollowing.go +++ b/builder/step_WithFollowing.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithMessage.go b/builder/step_WithMessage.go similarity index 99% rename from build/step_WithMessage.go rename to builder/step_WithMessage.go index 3104dc7c..ff55d6fb 100644 --- a/build/step_WithMessage.go +++ b/builder/step_WithMessage.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithNextSibling.go b/builder/step_WithNextSibling.go similarity index 99% rename from build/step_WithNextSibling.go rename to builder/step_WithNextSibling.go index f72486a8..b6943df3 100644 --- a/build/step_WithNextSibling.go +++ b/builder/step_WithNextSibling.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithParent.go b/builder/step_WithParent.go similarity index 98% rename from build/step_WithParent.go rename to builder/step_WithParent.go index 512ce650..2c885631 100644 --- a/build/step_WithParent.go +++ b/builder/step_WithParent.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithPrevSibling.go b/builder/step_WithPrevSibling.go similarity index 99% rename from build/step_WithPrevSibling.go rename to builder/step_WithPrevSibling.go index 3e134bf1..a56fc0ff 100644 --- a/build/step_WithPrevSibling.go +++ b/builder/step_WithPrevSibling.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithResponse.go b/builder/step_WithResponse.go similarity index 99% rename from build/step_WithResponse.go rename to builder/step_WithResponse.go index 5b85acac..e291d77b 100644 --- a/build/step_WithResponse.go +++ b/builder/step_WithResponse.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_WithRule.go b/builder/step_WithRule.go similarity index 99% rename from build/step_WithRule.go rename to builder/step_WithRule.go index 66f28765..5c526bf8 100644 --- a/build/step_WithRule.go +++ b/builder/step_WithRule.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/step_do.go b/builder/step_do.go similarity index 98% rename from build/step_do.go rename to builder/step_do.go index 2fae58e9..aa5a2cbc 100644 --- a/build/step_do.go +++ b/builder/step_do.go @@ -1,4 +1,4 @@ -package build +package builder import ( "io" diff --git a/build/urlvalues_test.go b/builder/urlvalues_test.go similarity index 98% rename from build/urlvalues_test.go rename to builder/urlvalues_test.go index 60fbdf37..77d2234a 100644 --- a/build/urlvalues_test.go +++ b/builder/urlvalues_test.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/build/utilities.go b/builder/utilities.go similarity index 99% rename from build/utilities.go rename to builder/utilities.go index 7d478a16..434d3d5d 100644 --- a/build/utilities.go +++ b/builder/utilities.go @@ -1,4 +1,4 @@ -package build +package builder import ( "bytes" diff --git a/domain/factory.go b/domain/factory.go index 8d2421fb..6a6e1f05 100644 --- a/domain/factory.go +++ b/domain/factory.go @@ -4,7 +4,7 @@ import ( "context" "strings" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/config" "github.com/EmissarySocial/emissary/model" "github.com/EmissarySocial/emissary/service" @@ -197,7 +197,7 @@ func (factory *Factory) Refresh(domain config.Domain, providers []config.Provide factory.Theme(), factory.User(), factory.Provider(), - build.FuncMap(factory.Icons()), + builder.FuncMap(factory.Icons()), ) // Populate EncryptionKey Service diff --git a/handler/admin.go b/handler/admin.go index e0bfad06..3eeb2edf 100644 --- a/handler/admin.go +++ b/handler/admin.go @@ -1,7 +1,7 @@ package handler import ( - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/domain" "github.com/EmissarySocial/emissary/model" "github.com/EmissarySocial/emissary/server" @@ -14,15 +14,15 @@ import ( // GetAdmin handles GET requests func GetAdmin(factoryManager *server.Factory) echo.HandlerFunc { - return buildAdmin(factoryManager, build.ActionMethodGet) + return buildAdmin(factoryManager, builder.ActionMethodGet) } // PostAdmin handles POST/DELETE requests func PostAdmin(factoryManager *server.Factory) echo.HandlerFunc { - return buildAdmin(factoryManager, build.ActionMethodPost) + return buildAdmin(factoryManager, builder.ActionMethodPost) } -func buildAdmin(factoryManager *server.Factory, actionMethod build.ActionMethod) echo.HandlerFunc { +func buildAdmin(factoryManager *server.Factory, actionMethod builder.ActionMethod) echo.HandlerFunc { const location = "handler.adminBuilder" @@ -82,7 +82,7 @@ func buildAdmin_ParsePath(ctx echo.Context) (string, string, primitive.ObjectID) return templateID, actionID, primitive.NilObjectID } -func buildAdmin_GetBuilder(factory *domain.Factory, ctx *steranko.Context, template model.Template, actionID string, objectID primitive.ObjectID) (build.Builder, error) { +func buildAdmin_GetBuilder(factory *domain.Factory, ctx *steranko.Context, template model.Template, actionID string, objectID primitive.ObjectID) (builder.Builder, error) { const location = "handler.buildAdmin_GetBuilder" @@ -101,10 +101,10 @@ func buildAdmin_GetBuilder(factory *domain.Factory, ctx *steranko.Context, templ } } - return build.NewRule(factory, ctx.Request(), ctx.Response(), &rule, template, actionID) + return builder.NewRule(factory, ctx.Request(), ctx.Response(), &rule, template, actionID) case "domain": - return build.NewDomain(factory, ctx.Request(), ctx.Response(), template, actionID) + return builder.NewDomain(factory, ctx.Request(), ctx.Response(), template, actionID) case "group": group := model.NewGroup() @@ -116,7 +116,7 @@ func buildAdmin_GetBuilder(factory *domain.Factory, ctx *steranko.Context, templ } } - return build.NewGroup(factory, ctx.Request(), ctx.Response(), template, &group, actionID) + return builder.NewGroup(factory, ctx.Request(), ctx.Response(), template, &group, actionID) case "stream": stream := model.NewStream() @@ -128,7 +128,7 @@ func buildAdmin_GetBuilder(factory *domain.Factory, ctx *steranko.Context, templ } } - return build.NewNavigation(factory, ctx.Request(), ctx.Response(), template, &stream, actionID) + return builder.NewNavigation(factory, ctx.Request(), ctx.Response(), template, &stream, actionID) case "user": user := model.NewUser() @@ -140,7 +140,7 @@ func buildAdmin_GetBuilder(factory *domain.Factory, ctx *steranko.Context, templ } } - return build.NewUser(factory, ctx.Request(), ctx.Response(), template, &user, actionID) + return builder.NewUser(factory, ctx.Request(), ctx.Response(), template, &user, actionID) default: return nil, derp.NewNotFoundError(location, "Template MODEL must be one of: 'rule', 'domain', 'group', 'stream', or 'user'", template.Model) diff --git a/handler/attachment.go b/handler/attachment.go index 50dfbce0..42e9fe0e 100644 --- a/handler/attachment.go +++ b/handler/attachment.go @@ -3,7 +3,7 @@ package handler import ( "net/http" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/model" "github.com/EmissarySocial/emissary/server" "github.com/benpate/derp" @@ -61,7 +61,7 @@ func GetAttachment(factoryManager *server.Factory) echo.HandlerFunc { } // Try to find the action requested by the user. This also enforces user permissions... - if _, err := build.NewStreamWithoutTemplate(factory, ctx.Request(), ctx.Response(), &stream, "view"); err != nil { + if _, err := builder.NewStreamWithoutTemplate(factory, ctx.Request(), ctx.Response(), &stream, "view"); err != nil { return derp.Wrap(err, location, "Cannot create builder") } diff --git a/handler/html.go b/handler/html.go index 6b8a3522..342e6081 100644 --- a/handler/html.go +++ b/handler/html.go @@ -4,22 +4,22 @@ import ( "bytes" "net/http" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/domain" "github.com/benpate/derp" "github.com/labstack/echo/v4" ) // buildHTML collects the logic to build complete vs. partial HTML pages. -func buildHTML(factory *domain.Factory, ctx echo.Context, builder build.Builder, actionMethod build.ActionMethod) error { +func buildHTML(factory *domain.Factory, ctx echo.Context, b builder.Builder, actionMethod builder.ActionMethod) error { const location = "handler.buildHTML" var partialPage bytes.Buffer // Execute the action pipeline - pipeline := build.Pipeline(builder.Action().Steps) + pipeline := builder.Pipeline(b.Action().Steps) - status := pipeline.Execute(factory, builder, &partialPage, actionMethod) + status := pipeline.Execute(factory, b, &partialPage, actionMethod) if status.Error != nil { return derp.Wrap(status.Error, location, "Error executing action pipeline") @@ -29,16 +29,16 @@ func buildHTML(factory *domain.Factory, ctx echo.Context, builder build.Builder, status.Apply(ctx.Response()) // Partial page requests can be completed here. - if builder.IsPartialRequest() || status.FullPage { + if b.IsPartialRequest() || status.FullPage { return ctx.HTML(status.GetStatusCode(), partialPage.String()) } // Full Page requests require the theme service to wrap the builded content htmlTemplate := factory.Domain().Theme().HTMLTemplate - builder.SetContent(partialPage.String()) + b.SetContent(partialPage.String()) var fullPage bytes.Buffer - if err := htmlTemplate.ExecuteTemplate(&fullPage, "page", builder); err != nil { + if err := htmlTemplate.ExecuteTemplate(&fullPage, "page", b); err != nil { return derp.Wrap(err, location, "Error building full-page content") } diff --git a/handler/inbox.go b/handler/inbox.go index e2a1d787..32c95d64 100644 --- a/handler/inbox.go +++ b/handler/inbox.go @@ -1,7 +1,7 @@ package handler import ( - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/model" "github.com/EmissarySocial/emissary/server" "github.com/benpate/derp" @@ -12,16 +12,16 @@ import ( // GetInbox handles GET requests func GetInbox(serverFactory *server.Factory) echo.HandlerFunc { - return buildInbox(serverFactory, build.ActionMethodGet) + return buildInbox(serverFactory, builder.ActionMethodGet) } // PostInbox handles POST/DELETE requests func PostInbox(serverFactory *server.Factory) echo.HandlerFunc { - return buildInbox(serverFactory, build.ActionMethodPost) + return buildInbox(serverFactory, builder.ActionMethodPost) } // buildInbox is the common Inbox handler for both GET and POST requests -func buildInbox(serverFactory *server.Factory, actionMethod build.ActionMethod) echo.HandlerFunc { +func buildInbox(serverFactory *server.Factory, actionMethod builder.ActionMethod) echo.HandlerFunc { const location = "handler.buildInbox" @@ -58,7 +58,7 @@ func buildInbox(serverFactory *server.Factory, actionMethod build.ActionMethod) return derp.Wrap(err, location, "Error building JSON-LD") } - builder, err := build.NewInbox(factory, context.Request(), context.Response(), &user, actionID) + builder, err := builder.NewInbox(factory, context.Request(), context.Response(), &user, actionID) if err != nil { return derp.Wrap(err, location, "Error creating builder") diff --git a/handler/oauth-server.go b/handler/oauth-server.go index a1a109bb..6eef0b65 100644 --- a/handler/oauth-server.go +++ b/handler/oauth-server.go @@ -4,7 +4,7 @@ import ( "net/http" "net/url" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/model" "github.com/EmissarySocial/emissary/server" "github.com/EmissarySocial/emissary/service" @@ -36,7 +36,7 @@ func GetOAuthAuthorization(serverFactory *server.Factory) echo.HandlerFunc { } // Load the OAuth Builder - builder, err := build.NewOAuthAuthorization(factory, transaction) + builder, err := builder.NewOAuthAuthorization(factory, transaction) if err != nil { return derp.Wrap(err, location, "Error Generating Builder") diff --git a/handler/outbox.go b/handler/outbox.go index 11d7549f..c82d885f 100644 --- a/handler/outbox.go +++ b/handler/outbox.go @@ -3,7 +3,7 @@ package handler import ( "net/http" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" activitypub "github.com/EmissarySocial/emissary/handler/activitypub_user" "github.com/EmissarySocial/emissary/model" "github.com/EmissarySocial/emissary/server" @@ -17,12 +17,12 @@ import ( // GetOutbox handles GET requests func GetOutbox(serverFactory *server.Factory) echo.HandlerFunc { - return buildOutbox(serverFactory, build.ActionMethodGet) + return buildOutbox(serverFactory, builder.ActionMethodGet) } // PostOutbox handles POST/DELETE requests func PostOutbox(serverFactory *server.Factory) echo.HandlerFunc { - return buildOutbox(serverFactory, build.ActionMethodPost) + return buildOutbox(serverFactory, builder.ActionMethodPost) } func GetProfileAvatar(serverFactory *server.Factory) echo.HandlerFunc { @@ -90,7 +90,7 @@ func GetProfileAvatar(serverFactory *server.Factory) echo.HandlerFunc { } // buildOutbox is the common Outbox handler for both GET and POST requests -func buildOutbox(serverFactory *server.Factory, actionMethod build.ActionMethod) echo.HandlerFunc { +func buildOutbox(serverFactory *server.Factory, actionMethod builder.ActionMethod) echo.HandlerFunc { const location = "handler.buildOutbox" @@ -136,7 +136,7 @@ func buildOutbox(serverFactory *server.Factory, actionMethod build.ActionMethod) return derp.Wrap(err, location, "Error building JSON-LD") } - builder, err := build.NewOutbox(factory, context.Request(), context.Response(), &user, actionID) + builder, err := builder.NewOutbox(factory, context.Request(), context.Response(), &user, actionID) if err != nil { return derp.Wrap(err, location, "Error creating builder") diff --git a/handler/setup_domain.go b/handler/setup_domain.go index 357ab19e..ffcf8962 100644 --- a/handler/setup_domain.go +++ b/handler/setup_domain.go @@ -4,7 +4,7 @@ import ( _ "embed" "net/http" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/config" "github.com/EmissarySocial/emissary/model" "github.com/EmissarySocial/emissary/server" @@ -45,7 +45,7 @@ func SetupDomainGet(factory *server.Factory) echo.HandlerFunc { return derp.Wrap(err, "handler.SetupDomainGet", "Error generating form") } - result := build.WrapModalForm(ctx.Response(), "/domains/"+domain.DomainID, formHTML) + result := builder.WrapModalForm(ctx.Response(), "/domains/"+domain.DomainID, formHTML) return ctx.HTML(200, result) } @@ -64,24 +64,24 @@ func SetupDomainPost(factory *server.Factory) echo.HandlerFunc { input := mapof.Any{} if err := (&echo.DefaultBinder{}).BindBody(ctx, &input); err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "handler.SetupDomainPost", "Error binding form input")) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "handler.SetupDomainPost", "Error binding form input")) } s := schema.New(config.DomainSchema()) if err := s.SetAll(&domain, input); err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "handler.SetupDomainPost", "Error setting config values")) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "handler.SetupDomainPost", "Error setting config values")) } if err := s.Validate(&domain); err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "handler.SetupDomainPost", "Error validating config values")) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "handler.SetupDomainPost", "Error validating config values")) } if err := factory.PutDomain(domain); err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "handler.SetupDomainPost", "Error saving domain")) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "handler.SetupDomainPost", "Error saving domain")) } - build.CloseModal(ctx) + builder.CloseModal(ctx) return ctx.NoContent(http.StatusOK) } } @@ -99,7 +99,7 @@ func SetupDomainDelete(factory *server.Factory) echo.HandlerFunc { } // Close the modal and return OK - build.RefreshPage(ctx) + builder.RefreshPage(ctx) return ctx.NoContent(http.StatusOK) } } diff --git a/handler/setup_oauth.go b/handler/setup_oauth.go index 6280f8cb..9b66427c 100644 --- a/handler/setup_oauth.go +++ b/handler/setup_oauth.go @@ -4,7 +4,7 @@ import ( "html/template" "net/http" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/config" "github.com/EmissarySocial/emissary/server" "github.com/EmissarySocial/emissary/tools/dataset" @@ -51,7 +51,7 @@ func SetupOAuthGet(factory *server.Factory, templates *template.Template) echo.H } // Wrap the form in a modal dialog - result := build.WrapModalForm(ctx.Response(), "/oauth/"+oAuthProviderID, formHTML) + result := builder.WrapModalForm(ctx.Response(), "/oauth/"+oAuthProviderID, formHTML) return ctx.HTML(200, result) } @@ -104,7 +104,7 @@ func SetupOAuthPost(factory *server.Factory, templates *template.Template) echo. } // Success! - build.CloseModal(ctx) + builder.CloseModal(ctx) return ctx.NoContent(http.StatusOK) } } diff --git a/handler/setup_server.go b/handler/setup_server.go index 5c9a5b44..297cb2cc 100644 --- a/handler/setup_server.go +++ b/handler/setup_server.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/model" "github.com/EmissarySocial/emissary/server" "github.com/benpate/derp" @@ -30,17 +30,17 @@ func SetupPageGet(factory *server.Factory, templates *template.Template, templat if useWrapper { if err := templates.ExecuteTemplate(ctx.Response().Writer, "_header.html", config); err != nil { - derp.Report(build.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.getIndex", "Error building index page"))) + derp.Report(builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.getIndex", "Error building index page"))) } } if err := templates.ExecuteTemplate(ctx.Response().Writer, templateID, config); err != nil { - derp.Report(build.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.getIndex", "Error building index page"))) + derp.Report(builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.getIndex", "Error building index page"))) } if useWrapper { if err := templates.ExecuteTemplate(ctx.Response().Writer, "_footer.html", config); err != nil { - derp.Report(build.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.getIndex", "Error building index page"))) + derp.Report(builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.getIndex", "Error building index page"))) } } @@ -81,7 +81,7 @@ func SetupServerGet(factory *server.Factory) echo.HandlerFunc { } // Return the form - return ctx.HTML(http.StatusOK, build.WrapForm(uri, result, "cancel-button:hide")) + return ctx.HTML(http.StatusOK, builder.WrapForm(uri, result, "cancel-button:hide")) } } @@ -93,7 +93,7 @@ func SetupServerPost(factory *server.Factory) echo.HandlerFunc { data := mapof.NewAny() if err := ctx.Bind(&data); err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.serverPost", "Error parsing form data")) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.serverPost", "Error parsing form data")) } // Data schema and UI schema @@ -106,7 +106,7 @@ func SetupServerPost(factory *server.Factory) echo.HandlerFunc { element, asTable, err := getSetupForm(section) if err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.serverTable", "Invalid table name")) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.serverTable", "Invalid table name")) } // Write Table-formatted forms. @@ -115,12 +115,12 @@ func SetupServerPost(factory *server.Factory) echo.HandlerFunc { // Apply the changes to the configuration if err := widget.Do(ctx.Request().URL, data); err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.serverTable", "Error saving form data")) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.serverTable", "Error saving form data")) } // Try to save the configuration to the persistent storage if err := factory.UpdateConfig(config); err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.postServer", "Internal error saving config. Try again later.")) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.postServer", "Internal error saving config. Try again later.")) } // Redraw the table @@ -132,16 +132,16 @@ func SetupServerPost(factory *server.Factory) echo.HandlerFunc { // Apply the changes to the configuration if err := form.SetAll(&config, data, nil); err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.serverPost", "Error saving form data", data)) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.serverPost", "Error saving form data", data)) } // Try to save the configuration to the persistent storage if err := factory.UpdateConfig(config); err != nil { - return build.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.postServer", "Internal error saving config. Try again later.")) + return builder.WrapInlineError(ctx.Response(), derp.Wrap(err, "setup.postServer", "Internal error saving config. Try again later.")) } // Success! - return build.WrapInlineSuccess(ctx.Response(), "Record Updated at: "+time.Now().Format(time.TimeOnly)) + return builder.WrapInlineSuccess(ctx.Response(), "Record Updated at: "+time.Now().Format(time.TimeOnly)) } } diff --git a/handler/setup_users.go b/handler/setup_users.go index bd240a0c..b419d802 100644 --- a/handler/setup_users.go +++ b/handler/setup_users.go @@ -5,7 +5,7 @@ import ( "html/template" "net/http" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/config" "github.com/EmissarySocial/emissary/domain" "github.com/EmissarySocial/emissary/model" @@ -37,7 +37,7 @@ func SetupDomainUsersGet(serverFactory *server.Factory, templates *template.Temp } // Wrap it as a modal - return ctx.HTML(http.StatusOK, build.WrapModal(ctx.Response(), modal, "class:large")) + return ctx.HTML(http.StatusOK, builder.WrapModal(ctx.Response(), modal, "class:large")) } } diff --git a/handler/startup.go b/handler/startup.go index fa52ceaf..0791ab4f 100644 --- a/handler/startup.go +++ b/handler/startup.go @@ -3,7 +3,7 @@ package handler import ( "net/http" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/server" "github.com/benpate/derp" "github.com/benpate/rosetta/first" @@ -43,7 +43,7 @@ func GetStartup(serverFactory *server.Factory) echo.HandlerFunc { actionID := first.String(ctx.Param("action"), "page") // Get a Builder for this page (also authenticates admin permissions) - builder, err := build.NewDomain(factory, ctx.Request(), ctx.Response(), template, actionID) + builder, err := builder.NewDomain(factory, ctx.Request(), ctx.Response(), template, actionID) if err != nil { return derp.Wrap(err, location, "Error creating builder") diff --git a/handler/stream.go b/handler/stream.go index f250dcd6..a658da99 100644 --- a/handler/stream.go +++ b/handler/stream.go @@ -3,7 +3,7 @@ package handler import ( "net/http" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/handler/activitypub_stream" "github.com/EmissarySocial/emissary/model" "github.com/EmissarySocial/emissary/server" @@ -23,22 +23,22 @@ func GetStream(serverFactory *server.Factory) echo.HandlerFunc { } // Otherwise, just build the stream normally - return buildStream(serverFactory, build.ActionMethodGet)(ctx) + return buildStream(serverFactory, builder.ActionMethodGet)(ctx) } } // GetStreamWithAction handles GET requests with a specified action func GetStreamWithAction(serverFactory *server.Factory) echo.HandlerFunc { - return buildStream(serverFactory, build.ActionMethodGet) + return buildStream(serverFactory, builder.ActionMethodGet) } // PostStreamWithAction handles POST requests with a specified action func PostStreamWithAction(serverFactory *server.Factory) echo.HandlerFunc { - return buildStream(serverFactory, build.ActionMethodPost) + return buildStream(serverFactory, builder.ActionMethodPost) } // buildStream is the common Stream handler for both GET and POST requests -func buildStream(serverFactory *server.Factory, actionMethod build.ActionMethod) echo.HandlerFunc { +func buildStream(serverFactory *server.Factory, actionMethod builder.ActionMethod) echo.HandlerFunc { const location = "handler.buildStream" @@ -74,7 +74,7 @@ func buildStream(serverFactory *server.Factory, actionMethod build.ActionMethod) return derp.Wrap(err, location, "Error building JSON-LD") } - builder, err := build.NewStreamWithoutTemplate(factory, ctx.Request(), ctx.Response(), &stream, actionID) + b, err := builder.NewStreamWithoutTemplate(factory, ctx.Request(), ctx.Response(), &stream, actionID) if err != nil { return derp.Wrap(err, location, "Error creating Builder") @@ -82,11 +82,11 @@ func buildStream(serverFactory *server.Factory, actionMethod build.ActionMethod) // Add webmention link header per: // https://www.w3.org/TR/webmention/#sender-discovers-receiver-webmention-endpoint - if actionMethod == build.ActionMethodGet { + if actionMethod == builder.ActionMethodGet { ctx.Response().Header().Set("Link", "/.webmention; rel=\"webmention\"") } - if err := buildHTML(factory, ctx, &builder, actionMethod); err != nil { + if err := buildHTML(factory, ctx, &b, actionMethod); err != nil { return derp.Wrap(err, location, "Error building page") } diff --git a/server/factory.go b/server/factory.go index 00ea7066..d9400c0c 100644 --- a/server/factory.go +++ b/server/factory.go @@ -7,7 +7,7 @@ import ( "strings" "sync" - "github.com/EmissarySocial/emissary/build" + "github.com/EmissarySocial/emissary/builder" "github.com/EmissarySocial/emissary/config" "github.com/EmissarySocial/emissary/domain" "github.com/EmissarySocial/emissary/service" @@ -498,7 +498,7 @@ func (factory *Factory) Widget() *service.Widget { // FuncMap returns the global funcMap (used by all templates) func (factory *Factory) FuncMap() template.FuncMap { - return build.FuncMap(factory.Icons()) + return builder.FuncMap(factory.Icons()) } // Icons returns the global icon collection diff --git a/service/template.go b/service/template.go index ac57d02b..97561e34 100644 --- a/service/template.go +++ b/service/template.go @@ -5,6 +5,7 @@ import ( "io/fs" "sort" "strconv" + "strings" "sync" "github.com/EmissarySocial/emissary/model" @@ -148,6 +149,12 @@ func (service *Template) loadTemplates() error { } directoryName := directory.Name() + + // Skip "hidden" directories + if strings.HasPrefix(directoryName, ".") { + continue + } + subdirectory, err := fs.Sub(filesystem, directoryName) if err != nil { @@ -158,7 +165,7 @@ func (service *Template) loadTemplates() error { definitionType, file, err := findDefinition(subdirectory) if err != nil { - derp.Report(derp.Wrap(err, "service.Template.loadTemplates", "Invalid definition", location)) + derp.Report(derp.Wrap(err, "service.Template.loadTemplates", "Invalid definition", location, directoryName)) continue } @@ -182,7 +189,7 @@ func (service *Template) loadTemplates() error { } default: - derp.Report(derp.NewInternalError("service.Template.loadTemplates", "Invalid definition", location)) + derp.Report(derp.NewInternalError("service.Template.loadTemplates", "Unrecognized definition type", location, definitionType)) } } }