morpheus-graphql-code-gen 0.18.0 → 0.19.0
raw patch · 7 files changed
+41/−41 lines, 7 filesdep ~morpheus-graphql-coredep ~optparse-applicativePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: morpheus-graphql-core, optparse-applicative
API changes (from Hackage documentation)
- Data.Morpheus.CodeGen.Internal.AST: unpackName :: Name t -> Text
+ Data.Morpheus.CodeGen.Internal.AST: unpackName :: forall (t :: NAME). NamePacking a => Name t -> a
Files
- changelog.md +2/−0
- morpheus-graphql-code-gen.cabal +4/−6
- src/Data/Morpheus/CodeGen/Internal/TH.hs +1/−1
- src/Data/Morpheus/CodeGen/Printing/GQLType.hs +2/−2
- src/Data/Morpheus/CodeGen/Printing/Render.hs +27/−27
- src/Data/Morpheus/CodeGen/Printing/Terms.hs +2/−2
- src/Data/Morpheus/CodeGen/Printing/Type.hs +3/−3
changelog.md view
@@ -1,3 +1,5 @@ # Changelog +## 0.19.0 - 21.03.2022+ ## 0.18.0 - 08.11.2021
morpheus-graphql-code-gen.cabal view
@@ -3,11 +3,9 @@ -- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack------ hash: abefa3a7c152fe401ea2fdbb8e9a4607248515d8be7b1633173ba783c10c4b3b name: morpheus-graphql-code-gen-version: 0.18.0+version: 0.19.0 synopsis: Morpheus GraphQL CLI description: code generator for Morpheus GraphQL category: web, graphql, cli@@ -48,7 +46,7 @@ base >=4.7 && <5 , bytestring >=0.10.4 && <0.11 , containers >=0.4.2.1 && <0.7- , morpheus-graphql-core >=0.18.0 && <0.19.0+ , morpheus-graphql-core >=0.19.0 && <0.20.0 , prettyprinter >=1.2 && <2.0 , relude >=0.3.0 && <1.1 , template-haskell >=2.0 && <3.0@@ -69,8 +67,8 @@ , containers >=0.4.2.1 && <0.7 , filepath >=1.1 && <1.5 , morpheus-graphql-code-gen- , morpheus-graphql-core >=0.18.0 && <0.19.0- , optparse-applicative >=0.12 && <0.17+ , morpheus-graphql-core >=0.19.0 && <0.20.0+ , optparse-applicative >=0.12 && <0.18 , prettyprinter >=1.2 && <2.0 , relude >=0.3.0 && <1.1 , template-haskell >=2.0 && <3.0
src/Data/Morpheus/CodeGen/Internal/TH.hs view
@@ -8,7 +8,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TemplateHaskellQuotes #-} {-# LANGUAGE NoImplicitPrelude #-} module Data.Morpheus.CodeGen.Internal.TH
src/Data/Morpheus/CodeGen/Printing/GQLType.hs view
@@ -18,13 +18,13 @@ parametrizedType, ) import Data.Text.Prettyprint.Doc- ( (<+>),- Doc,+ ( Doc, Pretty (pretty), indent, line, tupled, vsep,+ (<+>), ) import Relude hiding (optional, show) import Prelude (show)
src/Data/Morpheus/CodeGen/Printing/Render.hs view
@@ -28,41 +28,41 @@ ) import Data.Text.Lazy.Encoding (encodeUtf8) import Data.Text.Prettyprint.Doc- ( (<+>),- Doc,+ ( Doc, line, pretty, vsep,+ (<+>), ) import Relude hiding (ByteString, encodeUtf8) renderDocument :: String -> [ServerTypeDefinition] -> ByteString renderDocument moduleName types =- encodeUtf8- $ LT.fromStrict- $ pack- $ show- $ renderModuleDefinition- ModuleDefinition- { moduleName = pack moduleName,- imports =- [ ("Data.Data", ["Typeable"]),- ("Data.Morpheus.Kind", ["TYPE"]),- ("Data.Morpheus.Types", []),- ("Data.Text", ["Text"]),- ("GHC.Generics", ["Generic"]),- ("Data.Map", ["fromList", "empty"])- ],- extensions =- [ "DeriveAnyClass",- "DeriveGeneric",- "TypeFamilies",- "OverloadedStrings",- "DataKinds",- "DuplicateRecordFields"- ],- types- }+ encodeUtf8 $+ LT.fromStrict $+ pack $+ show $+ renderModuleDefinition+ ModuleDefinition+ { moduleName = pack moduleName,+ imports =+ [ ("Data.Data", ["Typeable"]),+ ("Data.Morpheus.Kind", ["TYPE"]),+ ("Data.Morpheus.Types", []),+ ("Data.Text", ["Text"]),+ ("GHC.Generics", ["Generic"]),+ ("Data.Map", ["fromList", "empty"])+ ],+ extensions =+ [ "DeriveAnyClass",+ "DeriveGeneric",+ "TypeFamilies",+ "OverloadedStrings",+ "DataKinds",+ "DuplicateRecordFields"+ ],+ types+ } renderModuleDefinition :: ModuleDefinition -> Doc n renderModuleDefinition
src/Data/Morpheus/CodeGen/Printing/Terms.hs view
@@ -23,12 +23,12 @@ ) import qualified Data.Text as T import Data.Text.Prettyprint.Doc- ( (<+>),- Doc,+ ( Doc, hsep, list, pretty, tupled,+ (<+>), ) import Relude hiding (optional)
src/Data/Morpheus/CodeGen/Printing/Type.hs view
@@ -32,8 +32,7 @@ renderWrapped, ) import Data.Text.Prettyprint.Doc- ( (<+>),- Doc,+ ( Doc, comma, enclose, indent,@@ -43,6 +42,7 @@ punctuate, tupled, vsep,+ (<+>), ) import Relude hiding (show) import Prelude (show)@@ -103,7 +103,7 @@ fieldType } = pure $- pretty (unpackName fieldName)+ pretty (unpackName fieldName :: Text) <+> "::" <+> unDoc (foldr renderWrapper (TypeDoc False $ pretty fieldType) wrappers)