json-spec-elm-servant 0.5.0.0 → 0.5.1.0
raw patch · 3 files changed
+22/−18 lines, 3 filesdep ~containersdep ~timePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: containers, time
API changes (from Hackage documentation)
- Data.JsonSpec.Elm.Servant: instance GHC.Classes.Eq Data.JsonSpec.Elm.Servant.HeaderParam
- Data.JsonSpec.Elm.Servant: instance GHC.Classes.Eq Data.JsonSpec.Elm.Servant.Param
- Data.JsonSpec.Elm.Servant: instance GHC.Classes.Eq Data.JsonSpec.Elm.Servant.PathParam
- Data.JsonSpec.Elm.Servant: instance GHC.Classes.Eq Data.JsonSpec.Elm.Servant.QP
- Data.JsonSpec.Elm.Servant: instance GHC.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.Capture.Capture name tpy)
- Data.JsonSpec.Elm.Servant: instance GHC.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.Header.Header' (Servant.API.Modifiers.Optional : mods) name a)
- Data.JsonSpec.Elm.Servant: instance GHC.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.Header.Header' (Servant.API.Modifiers.Required : mods) name a)
- Data.JsonSpec.Elm.Servant: instance GHC.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.QueryParam.QueryParam' (Servant.API.Modifiers.Optional : more) name typ)
- Data.JsonSpec.Elm.Servant: instance GHC.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.QueryParam.QueryParam' (Servant.API.Modifiers.Required : more) name typ)
- Data.JsonSpec.Elm.Servant: instance GHC.TypeLits.KnownSymbol segment => Data.JsonSpec.Elm.Servant.IsParam segment
- Data.JsonSpec.Elm.Servant: instance forall k1 (m :: k1) (c :: GHC.TypeNats.Nat) (t :: [*]) r (h :: [*]). Data.JsonSpec.Elm.Servant.Elmable (Servant.API.Verbs.Verb m c t r) => Data.JsonSpec.Elm.Servant.Elmable (Servant.API.Verbs.Verb m c t (Servant.API.ResponseHeaders.Headers h r))
- Data.JsonSpec.Elm.Servant: instance forall k1 (m :: k1) (c :: GHC.TypeNats.Nat) (t :: [*]). Servant.API.Verbs.ReflectMethod m => Data.JsonSpec.Elm.Servant.Elmable (Servant.API.Verbs.Verb m c t Servant.API.ContentTypes.NoContent)
- Data.JsonSpec.Elm.Servant: instance forall k1 response (method :: k1) (code :: GHC.TypeNats.Nat) (types :: [*]). (Data.JsonSpec.Elm.HasType (Data.JsonSpec.Encode.EncodingSpec response), Servant.API.Verbs.ReflectMethod method) => Data.JsonSpec.Elm.Servant.Elmable (Servant.API.Verbs.Verb method code types response)
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.Classes.Eq Data.JsonSpec.Elm.Servant.HeaderParam
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.Classes.Eq Data.JsonSpec.Elm.Servant.Param
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.Classes.Eq Data.JsonSpec.Elm.Servant.PathParam
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.Classes.Eq Data.JsonSpec.Elm.Servant.QP
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.Capture.Capture name tpy)
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.Header.Header' (Servant.API.Modifiers.Optional : mods) name a)
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.Header.Header' (Servant.API.Modifiers.Required : mods) name a)
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.QueryParam.QueryParam' (Servant.API.Modifiers.Optional : more) name typ)
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.TypeLits.KnownSymbol name => Data.JsonSpec.Elm.Servant.IsParam (Servant.API.QueryParam.QueryParam' (Servant.API.Modifiers.Required : more) name typ)
+ Data.JsonSpec.Elm.Servant: instance GHC.Internal.TypeLits.KnownSymbol segment => Data.JsonSpec.Elm.Servant.IsParam segment
+ Data.JsonSpec.Elm.Servant: instance forall k1 (m :: k1) (c :: GHC.Internal.TypeNats.Nat) (t :: [*]) r (h :: [*]). Data.JsonSpec.Elm.Servant.Elmable (Servant.API.Verbs.Verb m c t r) => Data.JsonSpec.Elm.Servant.Elmable (Servant.API.Verbs.Verb m c t (Servant.API.ResponseHeaders.Headers h r))
+ Data.JsonSpec.Elm.Servant: instance forall k1 (m :: k1) (c :: GHC.Internal.TypeNats.Nat) (t :: [*]). Servant.API.Verbs.ReflectMethod m => Data.JsonSpec.Elm.Servant.Elmable (Servant.API.Verbs.Verb m c t Servant.API.ContentTypes.NoContent)
+ Data.JsonSpec.Elm.Servant: instance forall k1 response (method :: k1) (code :: GHC.Internal.TypeNats.Nat) (types :: [*]). (Data.JsonSpec.Elm.HasType (Data.JsonSpec.Encode.EncodingSpec response), Servant.API.Verbs.ReflectMethod method) => Data.JsonSpec.Elm.Servant.Elmable (Servant.API.Verbs.Verb method code types response)
Files
- changelog.md +5/−0
- json-spec-elm-servant.cabal +3/−3
- src/Data/JsonSpec/Elm/Servant.hs +14/−15
changelog.md view
@@ -1,5 +1,10 @@ # Changelog +## 0.5.1.0++- Improved Elm generator output.+- Relaxed dependency bounds for `containers` and `time`.+ ## 0.5.0.0 - Added support for GHC 9.14.
json-spec-elm-servant.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: json-spec-elm-servant-version: 0.5.0.0+version: 0.5.1.0 synopsis: Generated elm code for servant APIs. description: Generate Elm encoders, decoders, and API requests for an Servant API, where the shape of the data@@ -26,7 +26,7 @@ build-depends: , base >= 4.19.2.0 && < 4.23 , bound >= 2.0.7 && < 2.1- , containers >= 0.6.8 && < 0.8+ , containers >= 0.6.8 && < 0.9 , directory >= 1.3.8.1 && < 1.4 , elm-syntax >= 0.3.3.0 && < 0.4 , filepath >= 1.4.200.1 && < 1.6@@ -78,7 +78,7 @@ , bytestring >= 0.12.0.2 && < 0.13 , cookie >= 0.4.6 && < 0.6 , hspec >= 2.11.1 && < 2.12- , time >= 1.12.2 && < 1.15+ , time >= 1.12.2 && < 1.16 , uuid >= 1.3.15 && < 1.4 if flag(compile-elm) main-is: test.hs
src/Data/JsonSpec/Elm/Servant.hs view
@@ -62,7 +62,7 @@ import Prelude ( Applicative(pure), Bool(False, True), Eq((==)) , Foldable(foldr, length), Functor(fmap), Maybe(Just, Nothing)- , Monad((>>=)), Monoid(mconcat, mempty), Semigroup((<>)), Show(show)+ , Monad((>>=)), Monoid(mconcat, mempty), Semigroup((<>)) , Traversable(sequence, traverse), ($), (.), (<$>), IO, Int, String, drop , error, init, putStrLn, reverse, unlines )@@ -786,11 +786,11 @@ error $ unlines [ ""- , " We successfully generated the elm code, but we are going to"- , " fail the test anyway because the the success criteria for"- , " the test is that the generated files on disk are _already_"- , " correct. You wouldn't want CI to pass in this case,"- , " for instance."+ , "Generated Elm modules were missing, so this test generated them."+ , ""+ , "To fix this failure, commit the generated modules."+ , "The test fails because generated files must already be correct"+ , "on disk before the test runs." ] True -> do checkModules definitions@@ -798,14 +798,12 @@ where elmFormat :: Text -> IO Text elmFormat elmCode = do- putStrLn $ "Formatting: " <> show elmCode result <- Text.pack <$> readProcess "elm-format" ["--stdin"] (Text.unpack elmCode)- putStrLn $ "Result: " <> show result pure result @@ -814,16 +812,17 @@ modulesOnDisk <- getFiles dir if modulesOnDisk == generatedModules then pure ()- else do- putStrLn $+ else+ error $ unlines- [ "expected: " <> show generatedModules- , "actual: " <> show modulesOnDisk+ [ ""+ , "Generated Elm modules do not match the files on disk." , ""+ , "To fix this failure, completely delete the `" <> pToStr dir <> "` directory "+ , "and then run this test again."+ , ""+ , "The test will regenerate the modules." ]- error $- "Please regenerate modules by completely deleting the `"- <> show dir <> "` directory and then running the test again." where getFiles :: OsPath -> IO (HashMap Module Text) getFiles path =