1
1
mirror of https://github.com/aelve/guide.git synced 2024-11-22 20:01:36 +03:00

Add “Guide.” to all modules

Nowadays lots of libraries don't use hierarchical modules so let's avoid
clashes with them.
This commit is contained in:
Artyom 2017-01-27 03:18:18 +03:00
parent 97a8f9a067
commit ee0610b396
No known key found for this signature in database
GPG Key ID: B8E35A33FF522710
18 changed files with 57 additions and 67 deletions

View File

@ -39,21 +39,21 @@ executable guide
, guide
ghc-options: -Wall -fno-warn-unused-do-bind
-threaded "-with-rtsopts=-T -N"
hs-source-dirs: src
hs-source-dirs: src/site
default-language: Haskell2010
library
exposed-modules:
Guide
Config
Types
Utils
Merge
Cache
Markdown
JS
View
SafeCopy
Guide.Server
Guide.Config
Guide.Types
Guide.Utils
Guide.Merge
Guide.Cache
Guide.Markdown
Guide.JS
Guide.View
Guide.SafeCopy
other-modules:
Imports
build-depends: Spock
@ -117,7 +117,7 @@ library
, xml
, xss-sanitize
ghc-options: -Wall -fno-warn-unused-do-bind
hs-source-dirs: lib
hs-source-dirs: src
default-language: Haskell2010
default-extensions: MultiWayIf
, ViewPatterns

View File

@ -1,4 +1,4 @@
module Cache
module Guide.Cache
(
CacheKey(..),
invalidateCache,
@ -16,9 +16,8 @@ import qualified Focus
-- Lucid
import Lucid.Base
-- local
import Types
import Utils
import Guide.Types
import Guide.Utils
-- Left = someone started rendering but haven't finished yet

View File

@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Config
module Guide.Config
(
Config(..),
readConfig,
@ -21,8 +21,7 @@ import qualified Data.ByteString.Lazy as BSL
-- Default
import Data.Default
-- Local
import Utils
import Guide.Utils
data Config = Config {

View File

@ -7,7 +7,7 @@
-- TODO: try to make it more type-safe somehow?
-- TODO: maybe use jmacro or something?
module JS where
module Guide.JS where
import Imports
@ -17,8 +17,7 @@ import qualified Data.Text.All as T
-- Interpolation
import NeatInterpolation
-- Local
import Utils
import Guide.Utils
-- | Javascript code.

View File

@ -2,7 +2,7 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
module Markdown
module Guide.Markdown
(
-- * Types
MarkdownInline(..),
@ -57,8 +57,7 @@ import ShortcutLinks.All (hackage)
-- acid-state
import Data.SafeCopy
-- Local
import Utils
import Guide.Utils
data MarkdownInline = MarkdownInline {

View File

@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
module Merge
module Guide.Merge
(
merge,
)

View File

@ -7,7 +7,7 @@
#endif
module SafeCopy
module Guide.SafeCopy
(
deriveSafeCopySorted,
)

View File

@ -4,7 +4,7 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
module Guide
module Guide.Server
(
main,
mainWith,
@ -53,15 +53,14 @@ import qualified SlaveThread as Slave
-- Watching the templates directory
import qualified System.FSNotify as FSNotify
-- Local
import Config
import Types
import View
import JS (JS(..), allJSFunctions)
import Utils
import Markdown
import Cache
import Merge
import Guide.Config
import Guide.Types
import Guide.View
import Guide.JS (JS(..), allJSFunctions)
import Guide.Utils
import Guide.Markdown
import Guide.Cache
import Guide.Merge
{- Note [acid-state]

View File

@ -8,7 +8,7 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Types
module Guide.Types
(
Trait(..),
ItemKind(..),
@ -140,10 +140,9 @@ import Data.IP
import Data.SafeCopy hiding (kind)
import Data.Acid as Acid
-- Local
import Utils
import SafeCopy
import Markdown
import Guide.Utils
import Guide.SafeCopy
import Guide.Markdown
{- Note [extending types]

View File

@ -10,7 +10,7 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Utils
module Guide.Utils
(
-- * Lists
moveUp,

View File

@ -2,7 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module View
module Guide.View
(
getJS,
getCSS,
@ -74,14 +74,13 @@ import qualified Data.List.NonEmpty as NonEmpty
import Text.Megaparsec
import Text.Megaparsec.Text
-- Local
import Config
import Types
import Utils
import JS (JS(..), JQuerySelector)
import qualified JS
import Markdown
import Cache
import Guide.Config
import Guide.Types
import Guide.Utils
import Guide.JS (JS(..), JQuerySelector)
import qualified Guide.JS as JS
import Guide.Markdown
import Guide.Cache
{- Note [autosize]

View File

@ -1,6 +0,0 @@
module Main where
import qualified Guide
main :: IO ()
main = Guide.main

6
src/site/Main.hs Normal file
View File

@ -0,0 +1,6 @@
module Main where
import qualified Guide.Server
main :: IO ()
main = Guide.Server.main

View File

@ -22,8 +22,7 @@ import Data.Tree
-- Testing
import Test.Hspec
-- Local
import Markdown
import Guide.Markdown
tests :: Spec

View File

@ -15,8 +15,7 @@ import Test.Hspec.QuickCheck
import Test.QuickCheck
import Data.Text.Arbitrary ()
-- Local
import Merge
import Guide.Merge
tests :: Spec

View File

@ -79,8 +79,7 @@ import qualified Test.Hspec.Expectations as Hspec
-- Exceptions
import Control.Monad.Catch
-- Local
import Utils (ordNub)
import Guide.Utils (ordNub)
getLink :: CanSelect s => s -> WD String

View File

@ -28,8 +28,8 @@ import Selenium
import qualified Test.WebDriver.Common.Keys as Key
-- Site
import qualified Guide
import Config (Config(..))
import qualified Guide.Server
import Guide.Config (Config(..))
-----------------------------------------------------------------------------
@ -611,7 +611,7 @@ run ts = do
--
-- Using 'Slave.fork' in 'Guide.mainWith' ensures that threads started
-- inside of 'mainWith' will be killed too when the thread dies.
tid <- Slave.fork $ Guide.mainWith Config {
tid <- Slave.fork $ Guide.Server.mainWith Config {
_baseUrl = "/",
_googleToken = "some-google-token",
_adminPassword = "123",