text-ansi 0.1.0 → 0.1.0.1
raw patch · 7 files changed
+50/−128 lines, 7 filesdep −text-builderdep ~basedep ~textPVP ok
version bump matches the API change (PVP)
Dependencies removed: text-builder
Dependency ranges changed: base, text
API changes (from Hackage documentation)
Files
- .travis.yml +0/−107
- CHANGELOG.md +8/−0
- Data/Text/ANSI.hs +16/−12
- README.md +1/−1
- cabal.project +5/−0
- cabal.project.freeze +6/−0
- text-ansi.cabal +14/−8
− .travis.yml
@@ -1,107 +0,0 @@-# This Travis job script has been generated by a script via-#-# runghc make_travis_yml_2.hs 'text-ansi.cabal'-#-# For more information, see https://github.com/haskell-CI/haskell-ci-#-language: c-sudo: false--git:- submodules: false # whether to recursively clone submodules--cache:- directories:- - $HOME/.cabal/packages- - $HOME/.cabal/store--before_cache:- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log- # remove files that are regenerated by 'cabal update'- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx-- - rm -rfv $HOME/.cabal/packages/head.hackage--matrix:- include:- - compiler: "ghc-8.6.2"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.2], sources: [hvr-ghc]}}- - compiler: "ghc-8.4.4"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}- - compiler: "ghc-8.2.2"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}--before_install:- - HC=${CC}- - HCPKG=${HC/ghc/ghc-pkg}- - unset CC- - ROOTDIR=$(pwd)- - mkdir -p $HOME/.local/bin- - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"- - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))- - echo $HCNUMVER--install:- - cabal --version- - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"- - BENCH=${BENCH---enable-benchmarks}- - TEST=${TEST---enable-tests}- - HADDOCK=${HADDOCK-true}- - UNCONSTRAINED=${UNCONSTRAINED-true}- - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}- - GHCHEAD=${GHCHEAD-false}- - travis_retry cabal update -v- - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"- - rm -fv cabal.project cabal.project.local- - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'- - "printf 'packages: \".\"\\n' > cabal.project"- - touch cabal.project.local- - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- text-ansi | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"- - cat cabal.project || true- - cat cabal.project.local || true- - if [ -f "./configure.ac" ]; then- (cd "." && autoreconf -i);- fi- - rm -f cabal.project.freeze- - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all- - rm -rf .ghc.environment.* "."/dist- - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)--# Here starts the actual work to be performed for the package under test;-# any command which exits with a non-zero exit code causes the build to fail.-script:- # test that source-distributions can be generated- - cabal new-sdist all- - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/- - cd ${DISTDIR} || false- - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;- - "printf 'packages: text-ansi-*/*.cabal\\n' > cabal.project"- - touch cabal.project.local- - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- text-ansi | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"- - cat cabal.project || true- - cat cabal.project.local || true- # this builds all libraries and executables (without tests/benchmarks)- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all-- # build & run tests, build benchmarks- - cabal new-build -w ${HC} ${TEST} ${BENCH} all-- # cabal check- - (cd text-ansi-* && cabal check)-- # haddock- - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi-- # Build without installed constraints for packages in global-db- - if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi--# REGENDATA ["text-ansi.cabal"]-# EOF
CHANGELOG.md view
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). +## [0.1.0.1] - 2020-06-14++### Changed+- Relax `base` bounds++### Removed+- Drop `text-builder` dependency+ ## [0.1.0] - 2018-11-14 ### Added
Data/Text/ANSI.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Data.Text.ANSI@@ -53,14 +54,17 @@ , overline ) where +#if !MIN_VERSION_base(4,13,0) import Data.Semigroup ((<>))+#endif import Data.Text+import Data.Text.Lazy.Builder (Builder) import Data.Word (Word8) import Foreign.C (CInt(CInt)) import System.IO.Unsafe (unsafePerformIO)-import Text.Builder (Builder)--import qualified Text.Builder as Builder+import qualified Data.Text.Lazy as Text.Lazy+import qualified Data.Text.Lazy.Builder as Builder+import qualified Data.Text.Lazy.Builder.Int as Builder -- $intro --@@ -188,11 +192,11 @@ rgb r g b = surround ("38;2;" <>- Builder.unsignedDecimal r <>+ Builder.decimal r <> semi <>- Builder.unsignedDecimal g <>+ Builder.decimal g <> semi <>- Builder.unsignedDecimal b)+ Builder.decimal b) "39" -- | RGB background.@@ -201,11 +205,11 @@ rgbBg r g b = surround ("48;2;" <>- Builder.unsignedDecimal r <>+ Builder.decimal r <> semi <>- Builder.unsignedDecimal g <>+ Builder.decimal g <> semi <>- Builder.unsignedDecimal b)+ Builder.decimal b) "49" {-# INLINABLE bold #-}@@ -248,15 +252,15 @@ {-# NOINLINE [1] surround #-} surround :: Builder -> Builder -> Text -> Text surround open close text- | isatty = Builder.run (esc <> open <> m <> Builder.text text <> esc <> close <> m)+ | isatty = Text.Lazy.toStrict (Builder.toLazyText (esc <> open <> m <> Builder.fromText text <> esc <> close <> m)) | otherwise = text esc :: Builder esc = "\ESC[" m, semi :: Builder-m = Builder.char 'm'-semi = Builder.char ';'+m = Builder.singleton 'm'+semi = Builder.singleton ';' {-# NOINLINE isatty #-} isatty :: Bool
README.md view
@@ -1,2 +1,2 @@-[](https://travis-ci.com/mitchellwrosen/text-ansi)+[](https://github.com/mitchellwrosen/text-ansi/actions) [](https://hackage.haskell.org/package/text-ansi)
+ cabal.project view
@@ -0,0 +1,5 @@+packages: .+index-state: 2020-06-14T23:29:31Z++package text-ansi+ ghc-options: -Werror
+ cabal.project.freeze view
@@ -0,0 +1,6 @@+constraints: any.array ==0.5.4.0,+ any.binary ==0.8.8.0,+ any.bytestring ==0.10.10.0,+ any.containers ==0.6.2.1,+ any.deepseq ==1.4.4.0,+ any.rts ==1.0
text-ansi.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2 name: text-ansi-version: 0.1.0+version: 0.1.0.1 category: Data synopsis: Text styling for ANSI terminals. description:@@ -23,10 +23,10 @@ license: BSD-3-Clause license-file: LICENSE build-type: Simple-tested-with: GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.2 extra-source-files:- .travis.yml+ cabal.project+ cabal.project.freeze CHANGELOG.md README.md @@ -36,13 +36,19 @@ library build-depends:- base ^>= 4.10 || ^>= 4.11 || ^>= 4.12- , text ^>= 1.0 || ^>= 1.1 || ^>= 1.2- , text-builder ^>= 0.6+ base >= 4.9 && < 4.15,+ text >= 1.0 && < 1.3, default-language: Haskell2010 exposed-modules: Data.Text.ANSI ghc-options:- -Wall- -Wcompat+ -Weverything+ -Wno-implicit-prelude+ -Wno-missing-import-lists+ -Wno-missing-local-signatures+ -Wno-unsafe+ if impl(ghc >= 8.10)+ ghc-options:+ -Wno-missing-safe-haskell-mode+ -Wno-prepositive-qualified-module