packages feed

colourista 0.1.0.0 → 0.1.0.1

raw patch · 9 files changed

+114/−34 lines, 9 filesdep +colouristadep +ghc-primdep +hspecdep ~ansi-terminaldep ~basedep ~bytestringnew-uploaderPVP ok

version bump matches the API change (PVP)

Dependencies added: colourista, ghc-prim, hspec

Dependency ranges changed: ansi-terminal, base, bytestring, text

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -3,6 +3,11 @@ `colourista` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +## 🐰🥚 0.1.0.1 — Apr 5, 2021++* [#55](https://github.com/kowainik/colourista/issues/55):+  Support GHC-9.0.+ ## 0.1.0.0 — May 2, 2020 🌈  * [#22](https://github.com/kowainik/colourista/issues/22):
README.md view
@@ -3,8 +3,6 @@ ![logo](https://user-images.githubusercontent.com/4276606/74611761-e7d69c80-50f6-11ea-8065-c9da0371b9bf.png)  [![GitHub CI](https://github.com/kowainik/colourista/workflows/CI/badge.svg)](https://github.com/kowainik/colourista/actions)-[![Build status](https://img.shields.io/travis/kowainik/colourista.svg?logo=travis)](https://travis-ci.org/kowainik/colourista)-[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/colourista?branch=master&svg=true)](https://ci.appveyor.com/project/kowainik/colourista) [![Hackage](https://img.shields.io/hackage/v/colourista.svg?logo=haskell)](https://hackage.haskell.org/package/colourista) [![Stackage Lts](http://stackage.org/package/colourista/badge/lts)](http://stackage.org/lts/package/colourista) [![Stackage Nightly](http://stackage.org/package/colourista/badge/nightly)](http://stackage.org/nightly/package/colourista)@@ -42,25 +40,27 @@  In order to start using `colourista` in your project, you will need to set it up with the three easy steps: -1. Add the dependency on `colorista` in your project's `.cabal` file. For this,+1. Add the dependency on `colourista` in your project's `.cabal` file. For this,    you should modify the `build-depends` section by adding the name of this    library. After the adjustment, this section could look like this:     ```haskell-   build-depends: base ^>= 4.14-                , colourista ^>= 0.0+   build-depends: colourista ^>= LATEST_VERSION+                , ...    ``` 2. In the module where you wish to use the colourful output with `colourista`,    you should add the import:     ```haskell-   import Colourista (successMessage)+   import Colourista (...)    ```-3. Now you can use the functions from the library:+3. Now you can use the functions from the library. For example:     ```haskell+   import qualified Data.Text as Text+    main :: IO ()-   main = successMessage "All set up!"+   main = successMessage $ Text.pack "All set up!"    ``` ### Usage with Stack @@ -70,8 +70,8 @@  ```yaml extra-deps:-  - colourista-0.0.0.0-  - ansi-terminal-0.10+  - colourista-0.1.0.0+  - ... ```  Then you can add it as a dependency in your `package.yaml` file as usual:
colourista.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.4 name:                colourista-version:             0.1.0.0+version:             0.1.0.1 synopsis:            Convenient interface for printing colourful messages description:         Convenient interface for printing colourful messages based on the @ansi-terminal@ library. homepage:            https://github.com/kowainik/colourista@@ -9,7 +9,7 @@ license-file:        LICENSE author:              Veronika Romashkina, Dmitrii Kovanikov maintainer:          Kowainik <xrom.xkov@gmail.com>-copyright:           2020 Kowainik+copyright:           2020-2021 Kowainik category:            Terminal, ANSI build-type:          Simple extra-doc-files:     README.md@@ -17,36 +17,34 @@ tested-with:         GHC == 8.2.2                      GHC == 8.4.4                      GHC == 8.6.5-                     GHC == 8.8.3-                     GHC == 8.10.1+                     GHC == 8.8.4+                     GHC == 8.10.4+                     GHC == 9.0.1  source-repository head   type:                git   location:            https://github.com/kowainik/colourista.git -library-  hs-source-dirs:      src-  exposed-modules:     Colourista-                         Colourista.IO-                         Colourista.Pure-                         Colourista.Short--  build-depends:       base >= 4.10.1.0 && < 4.15-                     , ansi-terminal ^>= 0.10-                     , bytestring ^>= 0.10-                     , text ^>= 1.2.3.0+common common-options+  build-depends:       base >= 4.10.1.0 && < 4.16    ghc-options:         -Wall-                       -Wincomplete-uni-patterns-                       -Wincomplete-record-updates                        -Wcompat                        -Widentities+                       -Wincomplete-uni-patterns+                       -Wincomplete-record-updates                        -Wredundant-constraints                        -fhide-source-paths-  if impl(ghc >= 8.8.1)+                       -freverse-errors+  if impl(ghc >= 8.4)+    ghc-options:       -Wmissing-export-lists+                       -Wpartial-fields+  if impl(ghc >= 8.8)     ghc-options:       -Wmissing-deriving-strategies                        -Werror=missing-deriving-strategies-  if impl(ghc >= 8.10.1)+                       -fwrite-ide-info+                       -hiedir=.hie+  if impl(ghc >= 8.10)     ghc-options:       -Wunused-packages    default-language:    Haskell2010@@ -64,3 +62,32 @@                        TupleSections                        TypeApplications                        ViewPatterns++library+  import:              common-options+  hs-source-dirs:      src+  exposed-modules:     Colourista+                         Colourista.IO+                         Colourista.Pure+                         Colourista.Short++  build-depends:       ansi-terminal >= 0.10 && < 0.12+                     , bytestring >= 0.10 && < 0.12+                     , ghc-prim >= 0.5 && < 0.8+                     , text ^>= 1.2.3.0++test-suite colourista-test+  import:              common-options+  type:                exitcode-stdio-1.0+  hs-source-dirs:      test+  main-is:             Spec.hs+  other-modules:       Test.Colourista++  build-depends:       colourista+                     , bytestring+                     , hspec ^>= 2.7.1+                     , text++  ghc-options:         -threaded+                       -rtsopts+                       -with-rtsopts=-N
src/Colourista.hs view
@@ -1,5 +1,5 @@ {- |-Copyright: (c) 2020 Kowainik+Copyright: (c) 2020-2021 Kowainik SPDX-License-Identifier: MPL-2.0 Maintainer: Kowainik <xrom.xkov@gmail.com> 
src/Colourista/IO.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-}  {- |-Copyright: (c) 2020 Kowainik+Copyright: (c) 2020-2021 Kowainik SPDX-License-Identifier: MPL-2.0 Maintainer: Kowainik <xrom.xkov@gmail.com> @@ -9,7 +9,7 @@ -}  module Colourista.IO-    ( -- * Color+    ( -- * Colour       -- ** Direct       redMessage     , greenMessage
src/Colourista/Pure.hs view
@@ -1,5 +1,5 @@ {- |-Copyright: (c) 2020 Kowainik+Copyright: (c) 2020-2021 Kowainik SPDX-License-Identifier: MPL-2.0 Maintainer: Kowainik <xrom.xkov@gmail.com> 
src/Colourista/Short.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-}  {- |-Copyright: (c) 2020 Kowainik+Copyright: (c) 2020-2021 Kowainik SPDX-License-Identifier: MPL-2.0 Maintainer: Kowainik <xrom.xkov@gmail.com> 
+ test/Spec.hs view
@@ -0,0 +1,9 @@+module Main (main) where++import Test.Hspec (hspec)++import Test.Colourista (colouristaSpec)+++main :: IO ()+main = hspec colouristaSpec
+ test/Test/Colourista.hs view
@@ -0,0 +1,39 @@+{-# LANGUAGE ImplicitParams #-}++module Test.Colourista+    ( colouristaSpec+    ) where++import Data.ByteString (ByteString)+import Data.Text (Text)+import Test.Hspec (Spec, describe, it, shouldBe)++import Colourista (formatWith, italic, red, reset, yellow)+import Colourista.Short (b, i, u)+++colouristaSpec :: Spec+colouristaSpec = describe "Colourista tests" $ do+    describe "Colour codes are actual strings" $ do+        it "Yellow: String" $+            yellow @String `shouldBe` "\ESC[93m"+        it "Yellow: Text" $+            yellow @Text `shouldBe` "\ESC[93m"+        it "Yellow: ByteString" $+            yellow @ByteString `shouldBe` "\ESC[93m"+        it "Reset: Text" $+            reset @Text `shouldBe` "\ESC[0m"++    describe "Colourista.Short" $ do+        it "Bold" $+            b @Text "bold" `shouldBe` "\ESC[1mbold\ESC[0m"+        it "Italic" $+            i @Text "italic" `shouldBe` "\ESC[3mitalic\ESC[0m"+        it "Underline" $+            u @Text "underline" `shouldBe` "\ESC[4munderline\ESC[0m"++    describe "'formatWith' works" $ do+        it "Format with empty list" $+            formatWith @Text [] "text" `shouldBe` "text"+        it "Format with red italic" $+            formatWith @Text [red, italic] "text" `shouldBe` "\ESC[91m\ESC[3mtext\ESC[0m"