dev:web: rename Hledger.Web.Foundation to Hledger.Web.App

This commit is contained in:
Simon Michael 2023-12-15 12:56:35 -10:00
parent 0396725e71
commit 8e0370bd58
5 changed files with 8 additions and 11 deletions

View File

@ -10,10 +10,7 @@
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE ViewPatterns #-}
-- | Define the web application's foundation, in the usual Yesod style. module Hledger.Web.App where
-- See a default Yesod app's comments for more details of each part.
module Hledger.Web.Foundation where
import Control.Applicative ((<|>)) import Control.Applicative ((<|>))
import Control.Monad (join, when, unless) import Control.Monad (join, when, unless)

View File

@ -26,9 +26,9 @@ import Hledger.Web.Handler.RegisterR
import Hledger.Web.Import import Hledger.Web.Import
import Hledger.Web.WebOptions (WebOpts(serve_,serve_api_), corsPolicy) import Hledger.Web.WebOptions (WebOpts(serve_,serve_api_), corsPolicy)
-- This line actually creates our YesodDispatch instance. It is the second half -- mkYesodDispatch creates our YesodDispatch instance.
-- of the call to mkYesodData which occurs in Foundation.hs. Please see the -- It complements the mkYesodData call in App.hs,
-- comments there for more details. -- but must be in a separate file for (TH?) reasons.
mkYesodDispatch "App" resourcesApp mkYesodDispatch "App" resourcesApp
-- This function allocates resources (such as a database connection pool), -- This function allocates resources (such as a database connection pool),

View File

@ -20,7 +20,7 @@ import Data.Traversable as Import
import Data.Void as Import (Void) import Data.Void as Import (Void)
import Text.Blaze as Import (Markup) import Text.Blaze as Import (Markup)
import Hledger.Web.Foundation as Import import Hledger.Web.App as Import
import Hledger.Web.Settings as Import import Hledger.Web.Settings as Import
import Hledger.Web.Settings.StaticFiles as Import import Hledger.Web.Settings.StaticFiles as Import
import Hledger.Web.WebOptions as Import (Permission(..)) import Hledger.Web.WebOptions as Import (Permission(..))

View File

@ -67,10 +67,10 @@ staticDir = "static"
-- files, more easily set expires and cache values, and avoid possibly -- files, more easily set expires and cache values, and avoid possibly
-- costly transference of cookies on static files. -- costly transference of cookies on static files.
-- --
-- If you change the resource pattern for StaticR in Foundation.hs, -- If you change the resource pattern for StaticR in App.hs,
-- (or staticDir above), you will have to make a corresponding change here. -- (or staticDir above), you will have to make a corresponding change here.
-- --
-- To see how this value is used, see urlRenderOverride in Foundation.hs -- To see how this value is used, see urlRenderOverride in App.hs
-- --
-- XXX Does not respect --file-url #2139 -- XXX Does not respect --file-url #2139
staticRoot :: AppConfig DefaultEnv Extra -> Text staticRoot :: AppConfig DefaultEnv Extra -> Text

View File

@ -25,7 +25,7 @@ import Text.Megaparsec (bundleErrors, eof, parseErrorTextPretty, runParser)
import Yesod import Yesod
import Hledger import Hledger
import Hledger.Web.Foundation (App, Handler, Widget) import Hledger.Web.App (App, Handler, Widget)
import Hledger.Web.Settings (widgetFile) import Hledger.Web.Settings (widgetFile)
import Data.Function ((&)) import Data.Function ((&))
import Control.Arrow (right) import Control.Arrow (right)