Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-shakespeare for openSUSE:Factory
checked in at 2022-08-01 21:30:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-shakespeare (Old)
and /work/SRC/openSUSE:Factory/.ghc-shakespeare.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-shakespeare"
Mon Aug 1 21:30:29 2022 rev:8 rq:987088 version:2.0.29
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-shakespeare/ghc-shakespeare.changes
2022-02-11 23:11:34.795322617 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-shakespeare.new.1533/ghc-shakespeare.changes
2022-08-01 21:30:50.069731437 +0200
@@ -1,0 +2,25 @@
+Tue May 24 14:55:41 UTC 2022 - Peter Simons <[email protected]>
+
+- Update shakespeare to version 2.0.29.
+ ### 2.0.29
+
+ * Support the upcoming `template-haskell` release with GHC 9.4
[#267](https://github.com/yesodweb/shakespeare/pull/267)
+
+ ### 2.0.28
+
+ * Add support for sub-blocks in mixins
[#264](https://github.com/yesodweb/shakespeare/pull/264)
+
+ ### 2.0.27
+
+ * Change how embedded templates are located by the compiler. Relative files
are now resolved using the Cabal project root, to fix builds of multi-project
codebases. [#266](https://github.com/yesodweb/shakespeare/pull/266)
+ * Change how messages are located by the compiler. The message directory is
now resolved using the Cabal project root, to fix builds of multi-project
codebases. [#266](https://github.com/yesodweb/shakespeare/pull/266)
+
+-------------------------------------------------------------------
+Fri Mar 4 05:18:20 UTC 2022 - Peter Simons <[email protected]>
+
+- Update shakespeare to version 2.0.26.
+ ### 2.0.26
+
+ * Support `@supports`
[#263](https://github.com/yesodweb/shakespeare/pull/263)
+
+-------------------------------------------------------------------
Old:
----
shakespeare-2.0.25.1.tar.gz
New:
----
shakespeare-2.0.29.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-shakespeare.spec ++++++
--- /var/tmp/diff_new_pack.fnfP8U/_old 2022-08-01 21:30:51.045734237 +0200
+++ /var/tmp/diff_new_pack.fnfP8U/_new 2022-08-01 21:30:51.057734271 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-shakespeare
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name shakespeare
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 2.0.25.1
+Version: 2.0.29
Release: 0
Summary: A toolkit for making compile-time interpolated templates
License: MIT
@@ -33,6 +33,7 @@
BuildRequires: ghc-containers-devel
BuildRequires: ghc-directory-devel
BuildRequires: ghc-exceptions-devel
+BuildRequires: ghc-file-embed-devel
BuildRequires: ghc-parsec-devel
BuildRequires: ghc-process-devel
BuildRequires: ghc-rpm-macros
++++++ shakespeare-2.0.25.1.tar.gz -> shakespeare-2.0.29.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.0.25.1/ChangeLog.md
new/shakespeare-2.0.29/ChangeLog.md
--- old/shakespeare-2.0.25.1/ChangeLog.md 2021-12-23 08:54:46.000000000
+0100
+++ new/shakespeare-2.0.29/ChangeLog.md 2022-05-24 16:55:36.000000000 +0200
@@ -1,5 +1,22 @@
# ChangeLog for shakespeare
+### 2.0.29
+
+* Support the upcoming `template-haskell` release with GHC 9.4
[#267](https://github.com/yesodweb/shakespeare/pull/267)
+
+### 2.0.28
+
+* Add support for sub-blocks in mixins
[#264](https://github.com/yesodweb/shakespeare/pull/264)
+
+### 2.0.27
+
+* Change how embedded templates are located by the compiler. Relative files
are now resolved using the Cabal project root, to fix builds of multi-project
codebases. [#266](https://github.com/yesodweb/shakespeare/pull/266)
+* Change how messages are located by the compiler. The message directory is
now resolved using the Cabal project root, to fix builds of multi-project
codebases. [#266](https://github.com/yesodweb/shakespeare/pull/266)
+
+### 2.0.26
+
+* Support `@supports` [#263](https://github.com/yesodweb/shakespeare/pull/263)
+
### 2.0.25.1
* Support for GHC 9.2 and aeson 2
[#260](https://github.com/yesodweb/shakespeare/pull/260)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.0.25.1/Text/Internal/Css.hs
new/shakespeare-2.0.29/Text/Internal/Css.hs
--- old/shakespeare-2.0.25.1/Text/Internal/Css.hs 2021-12-23
08:54:46.000000000 +0100
+++ new/shakespeare-2.0.29/Text/Internal/Css.hs 2022-05-24 16:55:36.000000000
+0200
@@ -67,7 +67,7 @@
data Mixin = Mixin
{ mixinAttrs :: ![Attr Resolved]
- , mixinBlocks :: ![Block Resolved]
+ , mixinBlocks :: ![(HasLeadingSpace, Block Resolved)]
}
deriving Lift
instance Semigroup Mixin where
@@ -176,6 +176,12 @@
parseBlocks'' <- parseBlocks'
return $ cr `AppE` parseBlocks'' `AppE` (LitE $ StringL fp) `AppE` ListE c
+runtimePrependSelector :: Builder -> (HasLeadingSpace, Block Resolved) ->
Block Resolved
+runtimePrependSelector builder (hsl, Block x b () ()) =
+ Block (builder <> addSpace x) b () ()
+ where
+ addSpace = if hsl then (TLB.singleton ' ' <>) else id
+
combineSelectors :: HasLeadingSpace
-> [Contents]
-> [Contents]
@@ -204,7 +210,9 @@
, blockAttrs = concat $ attrs' : map mixinAttrs mixins
, blockBlocks = ()
, blockMixins = ()
- } : foldr ($) rest z'
+ }
+ : fmap (runtimePrependSelector $ mconcat x') (concatMap mixinBlocks
mixins)
+ ++ foldr ($) rest z'
{-
(:) (Css' (mconcat $ map go' $ intercalate [ContentRaw "," ] x) (map go''
y))
. foldr (.) id (map (subGo x) z)
@@ -345,24 +353,28 @@
-> Block Unresolved
-> Q Exp
blockToMixin r scope (Block _sel props subblocks mixins) =
+ -- TODO: preserve the CPS in @mixinBlocks@ below
[|Mixin
{ mixinAttrs = concat
$ $(listE $ map go props)
: map mixinAttrs $mixinsE
- -- FIXME too many complications to implement sublocks for now...
- , mixinBlocks = [] -- foldr (.) id $(listE $ map subGo subblocks) []
- }|]
- {-
- . foldr (.) id $(listE $ map subGo subblocks)
- . (concatMap mixinBlocks $mixinsE ++)
+ , mixinBlocks = concat $(listE $ map subGo subblocks)
+ }
|]
- -}
where
mixinsE = return $ ListE $ map (derefToExp []) mixins
go (Attr x y) = conE 'Attr
`appE` (contentsToBuilder r scope x)
`appE` (contentsToBuilder r scope y)
- subGo (Block sel' b c d) = blockToCss r scope $ Block sel' b c d
+ -- We don't use the @hls@ to combine selectors, because the parent
+ -- selector for a mixin is the dummy @mixin@ selector. But we may want
+ -- to know later if the block needs a leading space, because the mixin
+ -- might include an @&@ which needs to mix correctly with the parent
+ -- block's selector.
+ subGo (hls, Block sel' b c d) =
+ [| map (\x -> ($(lift hls), x))
+ $ $(blockToCss r scope $ Block sel' b c d) []
+ |]
blockToCss :: Name
-> Scope
@@ -378,7 +390,9 @@
, blockMixins = ()
} :: Block Resolved):)
. foldr (.) id $(listE $ map subGo subblocks)
- . (concatMap mixinBlocks $mixinsE ++)
+ . (fmap (runtimePrependSelector $(selectorToBuilder r scope sel))
+ (concatMap mixinBlocks $mixinsE)
+ ++)
|]
where
mixinsE = return $ ListE $ map (derefToExp []) mixins
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.0.25.1/Text/Lucius.hs
new/shakespeare-2.0.29/Text/Lucius.hs
--- old/shakespeare-2.0.25.1/Text/Lucius.hs 2021-12-23 08:54:46.000000000
+0100
+++ new/shakespeare-2.0.29/Text/Lucius.hs 2022-05-19 06:17:23.000000000
+0200
@@ -238,7 +238,7 @@
ignore = many (whiteSpace1 <|> string' "<!--" <|> string' "-->")
>> return ()
ignore
- tl <- ((charset <|> media <|> impor <|> topAtBlock <|> var <|> fmap
TopBlock parseBlock) >>= \x -> go (front . (:) x))
+ tl <- ((charset <|> media <|> impor <|> supports <|> topAtBlock <|>
var <|> fmap TopBlock parseBlock) >>= \x -> go (front . (:) x))
<|> (return $ map compressTopLevel $ front [])
ignore
return tl
@@ -258,6 +258,12 @@
val <- parseContents ";"
_ <- char ';'
return $ TopAtDecl "import" val
+ supports = do
+ try $ stringCI "@supports "
+ selector <- parseContents "{"
+ _ <- char '{'
+ b <- parseBlocks id
+ return $ TopAtBlock "supports" selector b
var = try $ do
_ <- char '@'
isPage <- (try $ string "page " >> return True) <|>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.0.25.1/Text/Shakespeare/Base.hs
new/shakespeare-2.0.29/Text/Shakespeare/Base.hs
--- old/shakespeare-2.0.25.1/Text/Shakespeare/Base.hs 2021-12-23
08:54:46.000000000 +0100
+++ new/shakespeare-2.0.29/Text/Shakespeare/Base.hs 2022-05-24
16:55:36.000000000 +0200
@@ -27,9 +27,10 @@
, readFileRecompileQ
) where
-import Language.Haskell.TH.Syntax
+import Language.Haskell.TH.Syntax hiding (makeRelativeToProject)
import Language.Haskell.TH (appE)
import Data.Char (isUpper, isSymbol, isPunctuation, isAscii)
+import Data.FileEmbed (makeRelativeToProject)
import Text.ParserCombinators.Parsec
import Text.Parsec.Prim (Parsec)
import Data.List (intercalate)
@@ -283,11 +284,16 @@
--
-- @since 2.0.19
readFileQ :: FilePath -> Q String
-readFileQ fp = qRunIO (readUtf8FileString fp)
+readFileQ rawFp = do
+ fp <- makeRelativeToProject rawFp
+ qRunIO (readUtf8FileString fp)
-- | Embed file's content, converting newlines
-- and track file via ghc dependencies, recompiling on changes
--
-- @since 2.0.19
readFileRecompileQ :: FilePath -> Q String
-readFileRecompileQ fp = addDependentFile fp >> readFileQ fp
+readFileRecompileQ rawFp = do
+ fp <- makeRelativeToProject rawFp
+ addDependentFile fp
+ qRunIO (readUtf8FileString fp)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.0.25.1/Text/Shakespeare/I18N.hs
new/shakespeare-2.0.29/Text/Shakespeare/I18N.hs
--- old/shakespeare-2.0.25.1/Text/Shakespeare/I18N.hs 2021-12-23
08:54:46.000000000 +0100
+++ new/shakespeare-2.0.29/Text/Shakespeare/I18N.hs 2022-05-24
16:55:36.000000000 +0200
@@ -61,11 +61,12 @@
, Lang
) where
-import Language.Haskell.TH.Syntax
+import Language.Haskell.TH.Syntax hiding (makeRelativeToProject)
import Control.Applicative ((<$>))
import Control.Monad (filterM, forM)
import Data.Text (Text, pack, unpack)
import System.Directory
+import Data.FileEmbed (makeRelativeToProject)
import Data.Maybe (catMaybes)
import Data.List (isSuffixOf, sortBy, foldl')
import qualified Data.Map as Map
@@ -152,7 +153,8 @@
-> FilePath -- ^ path to translation folder
-> Lang -- ^ default lang
-> Q [Dec]
-mkMessageCommon genType prefix postfix master dt folder lang = do
+mkMessageCommon genType prefix postfix master dt rawFolder lang = do
+ folder <- makeRelativeToProject rawFolder
files <- qRunIO $ getDirectoryContents folder
let files' = filter (`notElem` [".", ".."]) files
(filess, contents) <- qRunIO $ fmap (unzip . catMaybes) $ mapM (loadLang
folder) files'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.0.25.1/shakespeare.cabal
new/shakespeare-2.0.29/shakespeare.cabal
--- old/shakespeare-2.0.25.1/shakespeare.cabal 2021-12-23 08:54:46.000000000
+0100
+++ new/shakespeare-2.0.29/shakespeare.cabal 2022-05-24 16:55:36.000000000
+0200
@@ -1,5 +1,5 @@
name: shakespeare
-version: 2.0.25.1
+version: 2.0.29
license: MIT
license-file: LICENSE
author: Michael Snoyman <[email protected]>
@@ -49,6 +49,7 @@
, blaze-markup
, blaze-html
, exceptions
+ , file-embed >= 0.0.1 && < 0.1
, transformers
, vector
, unordered-containers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/shakespeare-2.0.25.1/test/Text/CssSpec.hs
new/shakespeare-2.0.29/test/Text/CssSpec.hs
--- old/shakespeare-2.0.25.1/test/Text/CssSpec.hs 2021-12-23
08:54:46.000000000 +0100
+++ new/shakespeare-2.0.29/test/Text/CssSpec.hs 2022-05-24 16:55:36.000000000
+0200
@@ -288,6 +288,17 @@
}
|]
+ it "lucius supports" $ do
+ celper "@supports only screen{hana dul{set:net}}" $(luciusFile
"test/cassiuses/external-supports.lucius")
+ celper "@supports only screen {\n hana dul {\n set: net;\n
}\n}\n" $(luciusFileDebug "test/cassiuses/external-supports.lucius")
+ celper "@supports only screen {hana,dul{set:net;dasut:yeosut}}"
[lucius|
+ @supports only screen {
+ hana, dul {
+ set: net;
+ dasut: yeosut;
+ }
+ }
+ |]
{-
it "cassius removes whitespace" $ do
@@ -367,6 +378,21 @@
@mobileWidth: 400px;
@media (max-width: #{mobileWidth}){ foo { color: red; } }
|]
+ -- note: this file format is window (CR;NL)
+ it "variables in supports selector" $
+ celper "@supports ((perspective: 1px)\r\n and (not
(-webkit-overflow-scrolling: touch)))
{html,body{overflow:hidden;height:100%}body{transform:translateZ(0px)}}"
[lucius|
+@perspectiveTestValue: 1px;
+@supports ((perspective: #{perspectiveTestValue})
+ and (not (-webkit-overflow-scrolling: touch))) {
+ html, body {
+ overflow: hidden;
+ height:100%;
+ }
+ body {
+ transform: translateZ(0px);
+ }
+}
+|]
it "URLs in import" $ celper
"@import url(\"suburl\");" [lucius|
@import url("@{Sub SubUrl}");
@@ -401,14 +427,11 @@
it "lucius mixins" $ do
let bins = [luciusMixin|
bin:bin2;
- /* FIXME not currently implementing sublocks in mixins
foo2 {
- x: y
+ x: y;
}
- */
|] :: Mixin
- -- No sublocks celper "foo{bar:baz;bin:bin2}foo foo2{x:y}" [lucius|
- celper "foo{bar:baz;bin:bin2}" [lucius|
+ celper "foo{bar:baz;bin:bin2}foo foo2{x:y}" [lucius|
foo {
bar: baz;
^{bins}
@@ -418,9 +441,11 @@
let bins = [cassiusMixin|
bin:bin2
bin3:bin4
+
+ foo2
+ x:y
|] :: Mixin
- -- No sublocks celper "foo{bar:baz;bin:bin2}foo foo2{x:y}" [lucius|
- celper "foo{bar:baz;bin:bin2;bin3:bin4}" [lucius|
+ celper "foo{bar:baz;bin:bin2;bin3:bin4}foo foo2{x:y}" [lucius|
foo {
bar: baz;
^{bins}
@@ -443,17 +468,43 @@
}
|]
+ it "nested mixin blocks" $ do
+ let bar = [luciusMixin|
+ bar {
+ bin:baz;
+ }
+ |]
+ foo = [luciusMixin|
+ foo {
+ ^{bar}
+ }
+ |] :: Mixin
+ celper "selector foo bar{bin:baz}" [lucius|
+ selector {
+ ^{foo}
+ }
+ |]
+
+ it "mixins with pseudoselectors" $ do
+ let bar = [luciusMixin|
+ &:hover {
+ bin:baz;
+ }
+ |] :: Mixin
+ celper "foo:hover{bin:baz}" [lucius|
+ foo {
+ ^{bar}
+ }
+ |]
+
it "runtime mixin" $ do
let bins = [luciusMixin|
bin:bin2;
- /* FIXME not currently implementing sublocks in mixins
foo2 {
- x: y
+ x: y;
}
- */
|] :: Mixin
- -- No sublocks celper "foo{bar:baz;bin:bin2}foo foo2{x:y}" [lucius|
- Right (T.pack "foo{bar:baz;bin:bin2}") @=? luciusRTMixin
+ Right (T.pack "foo{bar:baz;bin:bin2}foo foo2{x:y}") @=? luciusRTMixin
(T.pack "foo { bar: baz; ^{bins} }")
True
[(TS.pack "bins", RTVMixin bins)]
@@ -550,7 +601,7 @@
-celper :: String -> CssUrl Url -> Assertion
+celper :: HasCallStack => String -> CssUrl Url -> Assertion
celper res h = do
let x = renderCssUrl render h
T.pack res @=? x
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/shakespeare-2.0.25.1/test/cassiuses/external-supports.lucius
new/shakespeare-2.0.29/test/cassiuses/external-supports.lucius
--- old/shakespeare-2.0.25.1/test/cassiuses/external-supports.lucius
1970-01-01 01:00:00.000000000 +0100
+++ new/shakespeare-2.0.29/test/cassiuses/external-supports.lucius
2022-05-19 06:17:23.000000000 +0200
@@ -0,0 +1,7 @@
+@supports only screen{
+ hana {
+ dul {
+ set: net;
+ }
+ }
+}