hasmin 0.3.2 → 0.3.2.1
raw patch · 5 files changed
+52/−5 lines, 5 filesdep +criteriondep +directorydep ~optparse-applicativePVP ok
version bump matches the API change (PVP)
Dependencies added: criterion, directory
Dependency ranges changed: optparse-applicative
API changes (from Hackage documentation)
Files
- CHANGELOG.md +22/−0
- benchmarks/Benchmarks.hs +11/−0
- hasmin.cabal +15/−2
- src/Hasmin/Parser/Internal.hs +2/−3
- src/Hasmin/Properties.hs +2/−0
+ CHANGELOG.md view
@@ -0,0 +1,22 @@+# Changelog++## 0.3.2.1+* Relaxed optparse-applicative upper bound.++## 0.3.2+* Fixed some dimensions minifying incorrectly.+* Fixed some Eq instances.+* <An+B> values data type modified to disallow invalid values. This makes the+ data type safer, also simplifying the Quickcheck Arbitrary instance.+* Improved test coverage.++## 0.3.1.3+* Added support for `@supports` rules, and a slight minification for them: it+ removes adjacent negations, i.e.: @supports not (not ...) gets turn into+ @supports ....+* Fixed a small bug with `:lang()` where spaces before the right parenthesis+ weren't being removed.+* Improved test coverage.++## 0.3.0.1+Initial release
+ benchmarks/Benchmarks.hs view
@@ -0,0 +1,11 @@+import System.Directory (getDirectoryContents, setCurrentDirectory)+import Criterion.Main+import qualified Data.Text.IO as TIO+import Hasmin++main :: IO ()+main = do+ setCurrentDirectory "../hasmin-benchmarks/bnch"+ xs <- getDirectoryContents "."+ ys <- traverse TIO.readFile (filter (flip notElem [".", ".."]) xs)+ defaultMain [bgroup "minification" [bench "a" $ nf (map minifyCSS) ys]]
hasmin.cabal view
@@ -1,5 +1,5 @@ name: hasmin -version: 0.3.2 +version: 0.3.2.1 license: BSD3 license-file: LICENSE author: (c) 2017 Cristian Adrián Ontivero <cristianontivero@gmail.com> @@ -10,6 +10,7 @@ category: Text build-type: Simple extra-source-files: README.md + CHANGELOG.md cabal-version: >=1.10 description: A CSS minifier which not only aims at reducing the amount of bytes of the @@ -35,7 +36,7 @@ build-depends: base >=4.9 && <5.1 , attoparsec >=0.12 && <0.14 , containers >=0.5 && <0.6 - , optparse-applicative >=0.11 && <0.14 + , optparse-applicative >=0.11 && <0.15 , parsers >=0.12.3 && <0.13 , text >=1.2 && <1.3 , hopfli >=0.2 && <0.4 @@ -130,4 +131,16 @@ , doctest >=0.11 && <0.12 , doctest-discover >=0.1.0.0 && <0.2 , doctest >=0.10 + , hasmin + +benchmark bench + default-language: Haskell2010 + type: exitcode-stdio-1.0 + hs-source-dirs: benchmarks + main-is: Benchmarks.hs + ghc-options: -threaded -Wall -fno-warn-orphans + build-depends: base >=4.9 && <5.1 + , criterion >=0.11 && <1.2 + , directory + , text >=1.2 && <1.3 , hasmin
src/Hasmin/Parser/Internal.hs view
@@ -18,8 +18,7 @@ ) where import Control.Arrow (first)-import Control.Applicative ((<|>), many, some)-import Control.Monad (mzero)+import Control.Applicative ((<|>), many, some, empty) import qualified Data.List.NonEmpty as NE import Data.Functor (($>)) import Data.Attoparsec.Combinator (lookAhead, sepBy, endOfInput)@@ -161,7 +160,7 @@ where handleSpecialCase :: Text -> Parser SimpleSelector handleSpecialCase t = if T.toCaseFold t `elem` specialPseudoElements then pure $ PseudoElem t- else mzero+ else empty -- \<An+B> microsyntax parser. anplusb :: Parser AnPlusB
src/Hasmin/Properties.hs view
@@ -32,6 +32,8 @@ shorthandAndLonghandsMap :: Map Text PropertyInfo shorthandAndLonghandsMap = Map.fromList properties +-- This holds the information of which shorthand overwrites which longhand, and+-- vice versa (which longhand is overwritten by which shorthand). properties :: [(Text,PropertyInfo)] properties = [("animation", PropertyInfo mempty ["animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state"])