mirror of
https://github.com/swarm-game/swarm.git
synced 2024-09-11 14:46:33 +03:00
web sublibrary (#1697)
Towards #1043 Creates a new sub-library for the web service. Also moved the `Swarm.App` module from the `swarm` library to the `swarm` executable.
This commit is contained in:
parent
ccd64fcff8
commit
f6f01b264c
@ -1,5 +1,9 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE NumericUnderscores #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
|
||||
{- HLINT ignore "Use underscore" -}
|
||||
|
||||
-- |
|
||||
-- SPDX-License-Identifier: BSD-3-Clause
|
71
swarm.cabal
71
swarm.cabal
@ -95,6 +95,38 @@ common ghc2021-extensions
|
||||
-- Not GHC2021, but until we get \cases we use \case a lot
|
||||
LambdaCase
|
||||
|
||||
library swarm-web
|
||||
import: stan-config, common, ghc2021-extensions
|
||||
exposed-modules: Swarm.Web
|
||||
Swarm.Web.Worldview
|
||||
other-modules: Paths_swarm
|
||||
autogen-modules: Paths_swarm
|
||||
build-depends: aeson,
|
||||
base,
|
||||
brick,
|
||||
bytestring,
|
||||
commonmark,
|
||||
colour,
|
||||
containers,
|
||||
lens,
|
||||
http-types,
|
||||
nonempty-containers,
|
||||
palette,
|
||||
servant-docs,
|
||||
servant-server >= 0.19 && < 0.21,
|
||||
text,
|
||||
witch,
|
||||
wai >= 3.2 && < 3.3,
|
||||
wai-app-static >= 3.1.8 && < 3.1.9,
|
||||
warp,
|
||||
build-depends: swarm-util,
|
||||
swarm,
|
||||
hs-source-dirs: src/swarm-web
|
||||
default-language: Haskell2010
|
||||
default-extensions:
|
||||
-- Avoid unexpected unevaluated thunk buildup
|
||||
-- See discussion in #415
|
||||
StrictData
|
||||
|
||||
library swarm-util
|
||||
import: stan-config, common, ghc2021-extensions
|
||||
@ -121,16 +153,16 @@ library swarm-util
|
||||
filepath >= 1.4 && < 1.5,
|
||||
fused-effects >= 1.1.1.1 && < 1.2,
|
||||
lens >= 4.19 && < 5.3,
|
||||
megaparsec >= 9.6.1 && < 9.7,
|
||||
minimorph >= 0.3 && < 0.4,
|
||||
mtl >= 2.2.2 && < 2.4,
|
||||
servant-docs >= 0.12 && < 0.14,
|
||||
template-haskell >= 2.16 && < 2.21,
|
||||
text >= 1.2.4 && < 2.1,
|
||||
transformers >= 0.5 && < 0.7,
|
||||
vector >= 0.12 && < 0.14,
|
||||
witch >= 1.1.1.0 && < 1.3,
|
||||
yaml >= 0.11 && < 0.11.12.0,
|
||||
transformers >= 0.5 && < 0.7,
|
||||
servant-docs >= 0.12 && < 0.14,
|
||||
megaparsec >= 9.6.1 && < 9.7,
|
||||
hs-source-dirs: src/swarm-util
|
||||
default-language: Haskell2010
|
||||
default-extensions:
|
||||
@ -140,8 +172,7 @@ library swarm-util
|
||||
|
||||
library
|
||||
import: stan-config, common, ghc2021-extensions
|
||||
exposed-modules: Swarm.App
|
||||
Swarm.Constant
|
||||
exposed-modules: Swarm.Constant
|
||||
Swarm.Doc.Keyword
|
||||
Swarm.Doc.Pedagogy
|
||||
Swarm.Doc.Util
|
||||
@ -288,8 +319,6 @@ library
|
||||
Swarm.TUI.Panel
|
||||
Swarm.Util.Effect
|
||||
Swarm.Version
|
||||
Swarm.Web
|
||||
Swarm.Web.Worldview
|
||||
|
||||
reexported-modules: Control.Carrier.Accum.FixedStrict
|
||||
, Data.BoolExpr.Simplify
|
||||
@ -347,9 +376,7 @@ library
|
||||
parser-combinators >= 1.2 && < 1.4,
|
||||
prettyprinter >= 1.7.0 && < 1.8,
|
||||
random >= 1.2.0 && < 1.3,
|
||||
wai-app-static >= 3.1.8 && < 3.1.9,
|
||||
servant-docs >= 0.12 && < 0.14,
|
||||
servant-server >= 0.19 && < 0.21,
|
||||
SHA >= 1.6.4 && < 1.6.5,
|
||||
simple-enumeration >= 0.2 && < 0.3,
|
||||
split >= 0.2.3 && < 0.3,
|
||||
@ -365,16 +392,11 @@ library
|
||||
unordered-containers >= 0.2.14 && < 0.3,
|
||||
vector >= 0.12 && < 0.14,
|
||||
vty >= 6.0 && < 6.1,
|
||||
wai >= 3.2 && < 3.3,
|
||||
warp >= 3.2 && < 3.4,
|
||||
witch >= 1.1.1.0 && < 1.3,
|
||||
witherable >= 0.4 && < 0.5,
|
||||
word-wrap >= 0.5 && < 0.6,
|
||||
yaml >= 0.11 && < 0.11.12.0
|
||||
if os(windows)
|
||||
build-depends: vty-windows >= 0.1.0.3 && < 0.2
|
||||
else
|
||||
build-depends: vty-unix >= 0.1.0.0 && < 0.2
|
||||
yaml >= 0.11 && < 0.11.12.0,
|
||||
build-depends: swarm-util
|
||||
hs-source-dirs: src
|
||||
default-language: Haskell2010
|
||||
@ -386,6 +408,7 @@ library
|
||||
executable swarm
|
||||
import: stan-config, common
|
||||
main-is: Main.hs
|
||||
other-modules: Swarm.App
|
||||
build-depends: optparse-applicative >= 0.16 && < 0.19,
|
||||
githash >= 0.1.6 && < 0.2,
|
||||
terminal-size >= 0.3 && < 1.0,
|
||||
@ -393,9 +416,18 @@ executable swarm
|
||||
servant >= 0.19 && < 0.21,
|
||||
-- Imports shared with the library don't need bounds
|
||||
base,
|
||||
text,
|
||||
brick,
|
||||
fused-effects,
|
||||
lens,
|
||||
prettyprinter,
|
||||
swarm
|
||||
text,
|
||||
vty,
|
||||
swarm,
|
||||
swarm-web,
|
||||
if os(windows)
|
||||
build-depends: vty-windows >= 0.1.0.3 && < 0.2,
|
||||
else
|
||||
build-depends: vty-unix >= 0.1.0.0 && < 0.2,
|
||||
hs-source-dirs: app
|
||||
default-language: Haskell2010
|
||||
ghc-options: -threaded
|
||||
@ -430,6 +462,7 @@ executable swarm-docs
|
||||
text,
|
||||
transformers,
|
||||
vector,
|
||||
swarm-web,
|
||||
hs-source-dirs: app/doc
|
||||
default-language: Haskell2010
|
||||
ghc-options: -threaded
|
||||
@ -472,7 +505,7 @@ test-suite swarm-unit
|
||||
text,
|
||||
time,
|
||||
witch,
|
||||
vty
|
||||
vty,
|
||||
hs-source-dirs: test/unit
|
||||
default-language: Haskell2010
|
||||
ghc-options: -threaded
|
||||
@ -495,7 +528,7 @@ test-suite swarm-integration
|
||||
swarm,
|
||||
text,
|
||||
witch,
|
||||
yaml
|
||||
yaml,
|
||||
hs-source-dirs: test/integration
|
||||
default-language: Haskell2010
|
||||
ghc-options: -threaded
|
||||
|
Loading…
Reference in New Issue
Block a user