git.iko.soy/haskell-servant/servant-elm
on master help sign in
Fix for elm-bridge-0.6.0
a80f8b4Kostiantyn Rybnikov
servant-elm.cabal+1−1
@@ -34,7 +34,7 @@ library
34 build-depends: base >= 4.7 && < 5
34 build-depends: base >= 4.7 && < 5
35 , aeson >= 0.9
35 , aeson >= 0.9
36 , directory
36 , directory
37− , elm-bridge >= 0.4
37+ , elm-bridge >= 0.5.2
38 , lens
38 , lens
39 , servant >= 0.8
39 , servant >= 0.8
40 , servant-foreign >= 0.8
40 , servant-foreign >= 0.8
src/Servant/Elm/Internal/Generate.hs+11−2
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE RecordWildCards #-}
2{-# LANGUAGE RecordWildCards #-}
2{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE MultiParamTypeClasses #-}
@@ -19,8 +20,11 @@ import Elm.Json (jsonParserForType, jsonSerForType)
19import qualified Elm.Module as Elm
20import qualified Elm.Module as Elm
20import Elm.TyRep (ETCon(..), EType(..), ETypeDef(..), toElmType)
21import Elm.TyRep (ETCon(..), EType(..), ETypeDef(..), toElmType)
21import Elm.TyRender (renderElm)
22import Elm.TyRender (renderElm)
23+#if MIN_VERSION_elm_bridge(0,6,0)
24+import Elm.Versions (ElmVersion(Elm0p19))
25+#else
22import Elm.Versions (ElmVersion(Elm0p18))
26import Elm.Versions (ElmVersion(Elm0p18))
23−
27+#endif
24import Servant.Elm.Internal.Foreign (LangElm, getEndpoints)
28import Servant.Elm.Internal.Foreign (LangElm, getEndpoints)
25import qualified Servant.Foreign as F
29import qualified Servant.Foreign as F
26import System.Directory (createDirectoryIfMissing)
30import System.Directory (createDirectoryIfMissing)
@@ -149,7 +153,12 @@ generateElmModuleWith ::
149generateElmModuleWith options namespace imports rootDir typeDefs api = do
153generateElmModuleWith options namespace imports rootDir typeDefs api = do
150 let out =
154 let out =
151 T.unlines $
155 T.unlines $
156+ [
157+#if MIN_VERSION_elm_bridge(0,6,0)
158+ T.pack $ Elm.moduleHeader Elm0p19 moduleName
159+#else
152− [ T.pack $ Elm.moduleHeader Elm0p18 moduleName
160+ T.pack $ Elm.moduleHeader Elm0p18 moduleName
161+#endif
153 , ""
162 , ""
154 , imports
163 , imports
155 , T.pack $ Elm.makeModuleContentWithAlterations (elmAlterations options) typeDefs
164 , T.pack $ Elm.makeModuleContentWithAlterations (elmAlterations options) typeDefs
stack.yaml+3−2
@@ -1,7 +1,8 @@
1−resolver: lts-14.6
1+resolver: lts-15.8
2packages:
2packages:
3- '.'
3- '.'
4extra-deps:
4extra-deps:
5−- elm-bridge-0.5.2
5+# - elm-bridge-0.5.2
6+- ../elm-bridge
6flags: {}
7flags: {}
7extra-package-dbs: []
8extra-package-dbs: []