autodocodec-yaml 0.1.0.1 → 0.2.0.0
raw patch · 4 files changed
+16/−13 lines, 4 filesdep ~safe-coloured-textPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: safe-coloured-text
API changes (from Hackage documentation)
- Autodocodec.Yaml: renderColouredSchemaVia :: ValueCodec input output -> ByteString
+ Autodocodec.Yaml: renderColouredSchemaVia :: ValueCodec input output -> Text
- Autodocodec.Yaml: renderColouredSchemaViaCodec :: forall a. HasCodec a => ByteString
+ Autodocodec.Yaml: renderColouredSchemaViaCodec :: forall a. HasCodec a => Text
- Autodocodec.Yaml: renderPlainSchemaVia :: ValueCodec input output -> ByteString
+ Autodocodec.Yaml: renderPlainSchemaVia :: ValueCodec input output -> Text
- Autodocodec.Yaml: renderPlainSchemaViaCodec :: forall a. HasCodec a => ByteString
+ Autodocodec.Yaml: renderPlainSchemaViaCodec :: forall a. HasCodec a => Text
- Autodocodec.Yaml.Schema: renderColouredSchemaVia :: ValueCodec input output -> ByteString
+ Autodocodec.Yaml.Schema: renderColouredSchemaVia :: ValueCodec input output -> Text
- Autodocodec.Yaml.Schema: renderColouredSchemaViaCodec :: forall a. HasCodec a => ByteString
+ Autodocodec.Yaml.Schema: renderColouredSchemaViaCodec :: forall a. HasCodec a => Text
- Autodocodec.Yaml.Schema: renderPlainSchemaVia :: ValueCodec input output -> ByteString
+ Autodocodec.Yaml.Schema: renderPlainSchemaVia :: ValueCodec input output -> Text
- Autodocodec.Yaml.Schema: renderPlainSchemaViaCodec :: forall a. HasCodec a => ByteString
+ Autodocodec.Yaml.Schema: renderPlainSchemaViaCodec :: forall a. HasCodec a => Text
Files
- CHANGELOG.md +6/−0
- autodocodec-yaml.cabal +3/−3
- src/Autodocodec/Yaml/IO.hs +1/−3
- src/Autodocodec/Yaml/Schema.hs +6/−7
CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## [0.2.0.1] - 2022-04-28++### Changed++* Changed `renderPlainSchemaVia`, `renderPlainSchemaViaCodec`, `renderColouredSchemaVia` and `renderColouredSchemaViaCodec` to output `Text` instead of `ByteString`.+ ## [0.1.0.1] - 2022-04-26 ### Added
autodocodec-yaml.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.5.+-- This file has been generated from package.yaml by hpack version 0.34.7. -- -- see: https://github.com/sol/hpack name: autodocodec-yaml-version: 0.1.0.1+version: 0.2.0.0 synopsis: Autodocodec interpreters for yaml homepage: https://github.com/NorfairKing/autodocodec#readme bug-reports: https://github.com/NorfairKing/autodocodec/issues@@ -41,7 +41,7 @@ , containers , path , path-io- , safe-coloured-text+ , safe-coloured-text >=0.2.0.0 , scientific , text , unordered-containers
src/Autodocodec/Yaml/IO.hs view
@@ -8,8 +8,6 @@ import Autodocodec.Yaml.Schema import qualified Data.ByteString as SB import qualified Data.Text as T-import qualified Data.Text.Encoding as TE-import qualified Data.Text.Encoding.Error as TE import qualified Data.Yaml as Yaml import Path import Path.IO@@ -50,7 +48,7 @@ fs -> "While parsing files:" : map (("* " <>) . toFilePath) fs referenceMsgs = [ "Reference: ",- T.unpack $ TE.decodeUtf8With TE.lenientDecode (renderColouredSchemaViaCodec @a)+ T.unpack $ renderColouredSchemaViaCodec @a ] die $ unlines $
src/Autodocodec/Yaml/Schema.hs view
@@ -9,7 +9,6 @@ import Autodocodec import Autodocodec.Schema-import Data.ByteString (ByteString) import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NE import qualified Data.Map as M@@ -22,20 +21,20 @@ import Text.Colour -- | Render a human-readable schema for a type's 'codec', in colour.-renderColouredSchemaViaCodec :: forall a. HasCodec a => ByteString+renderColouredSchemaViaCodec :: forall a. HasCodec a => Text renderColouredSchemaViaCodec = renderColouredSchemaVia (codec @a) -- | Render a human-readable schema for a given codec, in colour.-renderColouredSchemaVia :: ValueCodec input output -> ByteString-renderColouredSchemaVia = renderChunksBS With24BitColours . schemaChunksVia+renderColouredSchemaVia :: ValueCodec input output -> Text+renderColouredSchemaVia = renderChunksText With24BitColours . schemaChunksVia -- | Render a human-readable schema for a type's 'codec', without colour.-renderPlainSchemaViaCodec :: forall a. HasCodec a => ByteString+renderPlainSchemaViaCodec :: forall a. HasCodec a => Text renderPlainSchemaViaCodec = renderPlainSchemaVia (codec @a) -- | Render a human-readable schema for a given codec, without colour.-renderPlainSchemaVia :: ValueCodec input output -> ByteString-renderPlainSchemaVia = renderChunksBS WithoutColours . schemaChunksVia+renderPlainSchemaVia :: ValueCodec input output -> Text+renderPlainSchemaVia = renderChunksText WithoutColours . schemaChunksVia -- | Produce potentially-coloured 'Chunk's for a human-readable schema for a type's 'codec'. schemaChunksViaCodec :: forall a. HasCodec a => [Chunk]