From 0447d1ba6d70d5b14e8f27521abea56edee914c6 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Mon, 22 Aug 2022 19:48:20 +0100 Subject: [PATCH 01/11] Update to v0.15.4 - Removes badges since this is unmaintained, doesn't work with 9.2.3 and there is no alternative --- CHANGELOG.md | 5 +++++ config/routes | 1 - pursuit.cabal | 10 ++++------ src/Application.hs | 1 - src/GithubAPI.hs | 3 ++- src/Handler/Caching.hs | 1 - src/Handler/PackageBadges.hs | 36 ------------------------------------ src/Handler/Packages.hs | 4 ++-- src/SearchIndex.hs | 4 ++-- stack.yaml | 2 +- stack.yaml.lock | 8 ++++---- 11 files changed, 20 insertions(+), 55 deletions(-) delete mode 100644 src/Handler/PackageBadges.hs diff --git a/CHANGELOG.md b/CHANGELOG.md index 37301c5..fd2dba9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ the most up-to-date version of this file. ## Unreleased +- Update `purescript` to `0.15.4` (@sigma-andex) + + Update to GHC 9.2.3 required by Purescript v0.15.4 + Remove `barrier` since it is unmaintained and doesn't work with GHC 9.2.3. + ## v0.9.2 - Update `purescript` to `0.15.2` (@JordanMartinez) diff --git a/config/routes b/config/routes index 91ced88..920c06c 100644 --- a/config/routes +++ b/config/routes @@ -10,7 +10,6 @@ /packages/#PathPackageName/#PathVersion/docs PackageVersionDocsR GET /packages/#PathPackageName/#PathVersion/docs/#Text PackageVersionModuleDocsR GET !/packages/#PathPackageName/docs/#Text PackageModuleDocsR GET -!/packages/#PathPackageName/badge PackageBadgeR GET !/packages/#PathPackageName/available-versions PackageAvailableVersionsR GET /builtins/docs/#Text BuiltinDocsR GET diff --git a/pursuit.cabal b/pursuit.cabal index 553ccc9..7a843af 100644 --- a/pursuit.cabal +++ b/pursuit.cabal @@ -1,5 +1,5 @@ name: pursuit -version: 0.9.2 +version: 0.9.3 cabal-version: >= 1.8 build-type: Simple license: MIT @@ -26,7 +26,6 @@ library Handler.Common Handler.Database Handler.Help - Handler.PackageBadges Handler.Packages Handler.Search Handler.Utils @@ -76,7 +75,7 @@ library , classy-prelude >= 0.10.2 , classy-prelude-conduit >= 0.10.2 , classy-prelude-yesod >= 0.10.2 - , bytestring + , bytestring >= 0.11.3.1 , bytestring-trie , text , template-haskell @@ -102,7 +101,7 @@ library , containers , vector , time - , purescript == 0.15.2 + , purescript == 0.15.4 , bower-json , blaze-builder , blaze-markup @@ -125,7 +124,6 @@ library , transformers , cookie , xss-sanitize - , barrier , mono-traversable , streaming-commons @@ -140,7 +138,7 @@ executable pursuit hs-source-dirs: app build-depends: base, pursuit - ghc-options: -threaded -O2 -rtsopts -with-rtsopts=-N + ghc-options: -threaded -O2 -rtsopts -with-rtsopts=-N -Wunused-packages test-suite test type: exitcode-stdio-1.0 diff --git a/src/Application.hs b/src/Application.hs index b75f451..fc13cb6 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -38,7 +38,6 @@ import Handler.Common import Handler.Database import Handler.Packages import Handler.Search -import Handler.PackageBadges import Handler.Help import SearchIndex (emptySearchIndex, createSearchIndex, evalSearchIndex) diff --git a/src/GithubAPI.hs b/src/GithubAPI.hs index 0b9de50..06c39fc 100644 --- a/src/GithubAPI.hs +++ b/src/GithubAPI.hs @@ -9,6 +9,7 @@ import Import import Text.Blaze.Html (preEscapedToHtml) import qualified Data.ByteString.Lazy as BL import qualified Data.Aeson as A +import qualified Data.Aeson.KeyMap as KM import qualified Data.HashMap.Strict as HashMap import qualified Data.CaseInsensitive as CI import Text.HTML.SanitizeXSS (sanitize) @@ -93,7 +94,7 @@ getUser token = loginFromJSON val = case val of A.Object obj -> - case HashMap.lookup "login" obj of + case KM.lookup "login" obj of Just (A.String t) -> Just t _ -> Nothing _ -> Nothing diff --git a/src/Handler/Caching.hs b/src/Handler/Caching.hs index 89fb2bb..8cf69ea 100644 --- a/src/Handler/Caching.hs +++ b/src/Handler/Caching.hs @@ -102,7 +102,6 @@ clearCache pkgName version = do eachRouteDir [ PackageVersionR pkgName' (PathVersion version) , PackageAvailableVersionsR pkgName' - , PackageBadgeR pkgName' ] removeDirectoryRecursive diff --git a/src/Handler/PackageBadges.hs b/src/Handler/PackageBadges.hs deleted file mode 100644 index f7b4888..0000000 --- a/src/Handler/PackageBadges.hs +++ /dev/null @@ -1,36 +0,0 @@ - -module Handler.PackageBadges where - -import Import -import Data.Version -import qualified Text.Blaze as Blaze -import qualified Text.Blaze.Svg11 as S -import Text.Blaze.Svg.Renderer.Text (renderSvg) -import qualified Graphics.Badge.Barrier as Badge - -import Handler.Database (getLatestVersionFor) -import Handler.Caching (cacheSvg) - -newtype ContentSvg = ContentSvg { runContentSvg :: S.Svg } - -instance ToContent ContentSvg where - toContent = toContent . renderSvg . runContentSvg - -instance ToTypedContent ContentSvg where - toTypedContent = TypedContent typeSvg . toContent - -getPackageBadgeR :: PathPackageName -> Handler ContentSvg -getPackageBadgeR (PathPackageName pkgName) = - map ContentSvg $ cacheSvg $ do - msvg <- (map . map) renderBadge (getLatestVersionFor pkgName) - case msvg of - Just svg -> return svg - Nothing -> notFound - -renderBadge :: Version -> S.Svg -renderBadge version = - Blaze.unsafeLazyByteString (Badge.renderBadge badge left right) - where - badge = Badge.flat - left = "pursuit" - right = pack ('v' : showVersion version) diff --git a/src/Handler/Packages.hs b/src/Handler/Packages.hs index da34ac9..e26c967 100644 --- a/src/Handler/Packages.hs +++ b/src/Handler/Packages.hs @@ -10,8 +10,8 @@ import qualified Data.Text.Lazy as TL import Language.PureScript.CoreFn.FromJSON (parseVersion') import qualified Language.PureScript.Docs as D import Web.Bower.PackageMeta (PackageName, runPackageName, bowerDependencies, bowerLicense) -import qualified Data.HashMap.Strict as HashMap import qualified Data.Aeson as Aeson +import qualified Data.Aeson.KeyMap as KM import qualified Data.Aeson.BetterErrors as ABE import qualified Language.PureScript as P @@ -262,7 +262,7 @@ displayJsonError value e = case e of -- with. extractVersion = toObject - >=> HashMap.lookup "compilerVersion" + >=> KM.lookup "compilerVersion" >=> toString >=> (parseVersion' . unpack) diff --git a/src/SearchIndex.hs b/src/SearchIndex.hs index 4d5e497..ecf8eb4 100644 --- a/src/SearchIndex.hs +++ b/src/SearchIndex.hs @@ -297,7 +297,7 @@ extractChildDeclarationType declTitle declInfo cdeclInfo = where parentName :: P.Qualified (P.ProperName a) - parentName = P.Qualified Nothing (P.ProperName declTitle) + parentName = P.Qualified (P.ByNullSourcePos) (P.ProperName declTitle) addConstraint constraint = P.quantify . P.moveQuantifiersToFront . P.ConstrainedType () constraint @@ -467,7 +467,7 @@ typeComplexity (P.ParensInType _ t) = typeComplexity t typeComplexity _ = 0 compareQual :: Eq a => P.Qualified a -> P.Qualified a -> Bool -compareQual (P.Qualified (Just mn1) a1) (P.Qualified (Just mn2) a2) = mn1 == mn2 && a1 == a2 +compareQual (P.Qualified (P.ByModuleName mn1) a1) (P.Qualified (P.ByModuleName mn2) a2) = mn1 == mn2 && a1 == a2 compareQual (P.Qualified _ a1) (P.Qualified _ a2) = a1 == a2 runParser :: CST.Parser a -> Text -> Maybe a diff --git a/stack.yaml b/stack.yaml index 957107b..8554d74 100644 --- a/stack.yaml +++ b/stack.yaml @@ -11,7 +11,7 @@ extra-deps: - bytestring-trie-0.2.5.0 - classy-prelude-yesod-1.5.0 - language-javascript-0.7.0.0 - - purescript-0.15.2 + - purescript-0.15.4 - monoidal-containers-0.6.2.0 - process-1.6.13.1 - Cabal-3.2.1.0 diff --git a/stack.yaml.lock b/stack.yaml.lock index d1d7d34..68db077 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -33,12 +33,12 @@ packages: original: hackage: language-javascript-0.7.0.0 - completed: - hackage: purescript-0.15.0@sha256:901d26379aa58203103244fe190e840babcff60fc712b595ae8cc80978ffb35c,20095 + hackage: purescript-0.15.4@sha256:29fcb37f227a475a4357de52962f3564da6c881c146a679a514086d9883b1599,20642 pantry-tree: - size: 145589 - sha256: ba91174893b844de7093ddf71e815003c52b85b7ffe9dd289b4d35ddbb585a60 + size: 151335 + sha256: 6432cafb3d7b3334654d3e5c584eeada632e4c767403ede43953f2d3f33aa8ee original: - hackage: purescript-0.15.0 + hackage: purescript-0.15.4 - completed: hackage: monoidal-containers-0.6.2.0@sha256:124941d70df5e2928b4c6db605a1d0464e68c2c6b02e426db24a40194d43821d,2219 pantry-tree: From fdee091596439af4258e82189a52a2e73266632d Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Tue, 23 Aug 2022 07:20:02 +0100 Subject: [PATCH 02/11] Update src/SearchIndex.hs Co-authored-by: Justin Garcia --- src/SearchIndex.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchIndex.hs b/src/SearchIndex.hs index ecf8eb4..a229e3c 100644 --- a/src/SearchIndex.hs +++ b/src/SearchIndex.hs @@ -297,7 +297,7 @@ extractChildDeclarationType declTitle declInfo cdeclInfo = where parentName :: P.Qualified (P.ProperName a) - parentName = P.Qualified (P.ByNullSourcePos) (P.ProperName declTitle) + parentName = P.Qualified P.ByNullSourcePos (P.ProperName declTitle) addConstraint constraint = P.quantify . P.moveQuantifiersToFront . P.ConstrainedType () constraint From 58a01a5a362e307a4090f53f37bcddfe944ea8ea Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Fri, 26 Aug 2022 10:42:07 +0100 Subject: [PATCH 03/11] Revert removing of badges --- cabal.project | 6 ++++++ config/routes | 1 + pursuit.cabal | 3 ++- src/Application.hs | 1 + src/Handler/PackageBadges.hs | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 cabal.project create mode 100644 src/Handler/PackageBadges.hs diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..0378671 --- /dev/null +++ b/cabal.project @@ -0,0 +1,6 @@ +packages: . + +source-repository-package + type: git + location: https://github.com/PureFunctor/barrier.git + tag: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 diff --git a/config/routes b/config/routes index 920c06c..91ced88 100644 --- a/config/routes +++ b/config/routes @@ -10,6 +10,7 @@ /packages/#PathPackageName/#PathVersion/docs PackageVersionDocsR GET /packages/#PathPackageName/#PathVersion/docs/#Text PackageVersionModuleDocsR GET !/packages/#PathPackageName/docs/#Text PackageModuleDocsR GET +!/packages/#PathPackageName/badge PackageBadgeR GET !/packages/#PathPackageName/available-versions PackageAvailableVersionsR GET /builtins/docs/#Text BuiltinDocsR GET diff --git a/pursuit.cabal b/pursuit.cabal index 7a843af..5883a43 100644 --- a/pursuit.cabal +++ b/pursuit.cabal @@ -26,6 +26,7 @@ library Handler.Common Handler.Database Handler.Help + Handler.PackageBadges Handler.Packages Handler.Search Handler.Utils @@ -124,9 +125,9 @@ library , transformers , cookie , xss-sanitize + , barrier , mono-traversable , streaming-commons - if flag(dev) build-depends: foreign-store diff --git a/src/Application.hs b/src/Application.hs index fc13cb6..b75f451 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -38,6 +38,7 @@ import Handler.Common import Handler.Database import Handler.Packages import Handler.Search +import Handler.PackageBadges import Handler.Help import SearchIndex (emptySearchIndex, createSearchIndex, evalSearchIndex) diff --git a/src/Handler/PackageBadges.hs b/src/Handler/PackageBadges.hs new file mode 100644 index 0000000..f7b4888 --- /dev/null +++ b/src/Handler/PackageBadges.hs @@ -0,0 +1,36 @@ + +module Handler.PackageBadges where + +import Import +import Data.Version +import qualified Text.Blaze as Blaze +import qualified Text.Blaze.Svg11 as S +import Text.Blaze.Svg.Renderer.Text (renderSvg) +import qualified Graphics.Badge.Barrier as Badge + +import Handler.Database (getLatestVersionFor) +import Handler.Caching (cacheSvg) + +newtype ContentSvg = ContentSvg { runContentSvg :: S.Svg } + +instance ToContent ContentSvg where + toContent = toContent . renderSvg . runContentSvg + +instance ToTypedContent ContentSvg where + toTypedContent = TypedContent typeSvg . toContent + +getPackageBadgeR :: PathPackageName -> Handler ContentSvg +getPackageBadgeR (PathPackageName pkgName) = + map ContentSvg $ cacheSvg $ do + msvg <- (map . map) renderBadge (getLatestVersionFor pkgName) + case msvg of + Just svg -> return svg + Nothing -> notFound + +renderBadge :: Version -> S.Svg +renderBadge version = + Blaze.unsafeLazyByteString (Badge.renderBadge badge left right) + where + badge = Badge.flat + left = "pursuit" + right = pack ('v' : showVersion version) From ad536a8fa5403428ff33942bcfcdf761ee474f01 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Fri, 26 Aug 2022 10:45:39 +0100 Subject: [PATCH 04/11] Update changelog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd2dba9..3caca54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,6 @@ the most up-to-date version of this file. - Update `purescript` to `0.15.4` (@sigma-andex) Update to GHC 9.2.3 required by Purescript v0.15.4 - Remove `barrier` since it is unmaintained and doesn't work with GHC 9.2.3. ## v0.9.2 From 17efd61aa4de27ae78346ba6da82e7fbd5c38f56 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Fri, 26 Aug 2022 11:47:41 +0100 Subject: [PATCH 05/11] Update stack --- stack.yaml | 3 ++- stack.yaml.lock | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/stack.yaml b/stack.yaml index 8554d74..ca7eddd 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,7 +7,8 @@ packages: - "." extra-deps: - - barrier-0.1.1 + - git: https://github.com/PureFunctor/barrier.git + commit: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 - bytestring-trie-0.2.5.0 - classy-prelude-yesod-1.5.0 - language-javascript-0.7.0.0 diff --git a/stack.yaml.lock b/stack.yaml.lock index 68db077..07da4bb 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -5,17 +5,21 @@ packages: - completed: - hackage: barrier-0.1.1@sha256:2021f84c3aba67bb635d72825d3bc0371942444dc014bc307b875071e29eea98,3931 + name: barrier + version: 0.1.1 + git: https://github.com/PureFunctor/barrier.git pantry-tree: - size: 1695 - sha256: 2296d051562ead243beb831f20e216b44365e290ae76976cde7edd344e95bf29 + size: 1892 + sha256: c87d5adc48b644c76a4a07f31a98da6233f0ba5c2a386443e1ed2ec2261596c5 + commit: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 original: - hackage: barrier-0.1.1 + git: https://github.com/PureFunctor/barrier.git + commit: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 - completed: - hackage: bytestring-trie-0.2.5.0@sha256:9efa9c6f556314d28486be2470ff789419c5238ed2e354870623a3cbbd28fbe2,3349 + hackage: bytestring-trie-0.2.5.0@sha256:2ebdf9ab8bfa82b324592f0f203b41b57423912a4a9509b76cf22fc1cf344d7c,3427 pantry-tree: size: 705 - sha256: bdc13e00a60830edee41119af62b7203602377ccd81a6555c4fea95b0cb3a252 + sha256: 4ce59841d2d44dc36634652c65560c467d98416e3b15280e1314a54eac18a8d7 original: hackage: bytestring-trie-0.2.5.0 - completed: @@ -40,10 +44,10 @@ packages: original: hackage: purescript-0.15.4 - completed: - hackage: monoidal-containers-0.6.2.0@sha256:124941d70df5e2928b4c6db605a1d0464e68c2c6b02e426db24a40194d43821d,2219 + hackage: monoidal-containers-0.6.2.0@sha256:97289baf716f22fdae04b4fcbee066453d2f4c630ef3f631aeeab61ee713841e,2309 pantry-tree: size: 569 - sha256: 07ceac751866bad09af45df7d0ae97420d659221e8a0d85407705dcda1f6e89b + sha256: 55c0b7f60f8350546d437c9c0ad52c1dba35cac727972e7dc0f12201870df62f original: hackage: monoidal-containers-0.6.2.0 - completed: From 6bbb357267c78fcb98f379b9088da52d382eca25 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Fri, 26 Aug 2022 12:44:52 +0100 Subject: [PATCH 06/11] Update stack --- stack.yaml | 11 ++++++++--- stack.yaml.lock | 31 +++++++++++++++++++------------ 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/stack.yaml b/stack.yaml index ca7eddd..ee2d2d5 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-18.15 +resolver: nightly-2022-06-09 # Resolves hjsmin requiring language-javascript ==0.6, while the purescript # compiler requires language-javascript ==0.7. allow-newer: true @@ -9,13 +9,15 @@ packages: extra-deps: - git: https://github.com/PureFunctor/barrier.git commit: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 - - bytestring-trie-0.2.5.0 + #- bytestring-trie-0.2.5.0 + - bytestring-trie-0.2.7@sha256:f78e9d1dba699ce56080824693787918e9e8904db99d04d3470941420b1dd3ed,9010 - classy-prelude-yesod-1.5.0 - language-javascript-0.7.0.0 - purescript-0.15.4 - monoidal-containers-0.6.2.0 + - protolude-0.3.1 - process-1.6.13.1 - - Cabal-3.2.1.0 + - Cabal-3.6.3.0 flags: pursuit: @@ -24,3 +26,6 @@ flags: lib-only: true these: assoc: false +system-ghc: true +compiler: ghc-9.2.3 +compiler-check: match-exact diff --git a/stack.yaml.lock b/stack.yaml.lock index 07da4bb..95e04b1 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -16,12 +16,12 @@ packages: git: https://github.com/PureFunctor/barrier.git commit: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 - completed: - hackage: bytestring-trie-0.2.5.0@sha256:2ebdf9ab8bfa82b324592f0f203b41b57423912a4a9509b76cf22fc1cf344d7c,3427 + hackage: bytestring-trie-0.2.7@sha256:f78e9d1dba699ce56080824693787918e9e8904db99d04d3470941420b1dd3ed,9010 pantry-tree: - size: 705 - sha256: 4ce59841d2d44dc36634652c65560c467d98416e3b15280e1314a54eac18a8d7 + size: 1221 + sha256: b1f438713b95d8e1e95af11c5d747d1fa9b647c2f55be817ff91e4bd4d69ca00 original: - hackage: bytestring-trie-0.2.5.0 + hackage: bytestring-trie-0.2.7@sha256:f78e9d1dba699ce56080824693787918e9e8904db99d04d3470941420b1dd3ed,9010 - completed: hackage: classy-prelude-yesod-1.5.0@sha256:8f7e183bdfd6d2ea9674284c4f285294ab086aff60d9be4e5d7d2f3c1a2b05b7,1330 pantry-tree: @@ -50,6 +50,13 @@ packages: sha256: 55c0b7f60f8350546d437c9c0ad52c1dba35cac727972e7dc0f12201870df62f original: hackage: monoidal-containers-0.6.2.0 +- completed: + hackage: protolude-0.3.1@sha256:1cc9e5a5c26c33a43c52b554443dd9779fef13974eaa0beec7ca6d2551b400da,2647 + pantry-tree: + size: 1645 + sha256: 6452a6ca8d395f7d810139779bb0fd16fc1dbb00f1862630bc08ef5a100430f9 + original: + hackage: protolude-0.3.1 - completed: hackage: process-1.6.13.1@sha256:c8bb8b7c993ff72d771381b3b56852dd154bce51880a24789c11f57b0688d353,2963 pantry-tree: @@ -58,15 +65,15 @@ packages: original: hackage: process-1.6.13.1 - completed: - hackage: Cabal-3.2.1.0@sha256:8743076ec022296f9771d962000c9ca3a0fe02e68c37b992c63e382a675f791d,27482 + hackage: Cabal-3.6.3.0@sha256:ff97c442b0c679c1c9876acd15f73ac4f602b973c45bde42b43ec28265ee48f4,12459 pantry-tree: - size: 41224 - sha256: 92682a2aab8d967de341acff88525376eb9a31f53f094e0878c51c2886564f3a + size: 19757 + sha256: b250a53bdb56844f047a2927833bb565b936a289abfa85dfc2a63148d776368a original: - hackage: Cabal-3.2.1.0 + hackage: Cabal-3.6.3.0 snapshots: - completed: - size: 586286 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/15.yaml - sha256: 2c9cb11d7aa0656bf28672dcb2414ab21e3ba9ea83ca170c216b2c2fc7e55856 - original: lts-18.15 + size: 607265 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/6/9.yaml + sha256: 819ac07621dac5b2c320c45cb8c27f141f95114a1749b19b06d2c3606c79e839 + original: nightly-2022-06-09 From f9b5fb1c70de94a79e5b6c70c56e2e119ee74f56 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Sat, 27 Aug 2022 11:07:33 +0100 Subject: [PATCH 07/11] Fix pr comments --- src/Handler/Caching.hs | 1 + stack.yaml | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Handler/Caching.hs b/src/Handler/Caching.hs index 8cf69ea..89fb2bb 100644 --- a/src/Handler/Caching.hs +++ b/src/Handler/Caching.hs @@ -102,6 +102,7 @@ clearCache pkgName version = do eachRouteDir [ PackageVersionR pkgName' (PathVersion version) , PackageAvailableVersionsR pkgName' + , PackageBadgeR pkgName' ] removeDirectoryRecursive diff --git a/stack.yaml b/stack.yaml index ee2d2d5..b476bf7 100644 --- a/stack.yaml +++ b/stack.yaml @@ -26,6 +26,3 @@ flags: lib-only: true these: assoc: false -system-ghc: true -compiler: ghc-9.2.3 -compiler-check: match-exact From 2ac05d49c0da5024d1b9e8277b158b7af8820ad5 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Sat, 27 Aug 2022 11:08:22 +0100 Subject: [PATCH 08/11] Cleanup stack --- stack.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/stack.yaml b/stack.yaml index b476bf7..8c2a530 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: extra-deps: - git: https://github.com/PureFunctor/barrier.git commit: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 - #- bytestring-trie-0.2.5.0 - bytestring-trie-0.2.7@sha256:f78e9d1dba699ce56080824693787918e9e8904db99d04d3470941420b1dd3ed,9010 - classy-prelude-yesod-1.5.0 - language-javascript-0.7.0.0 From dcfc61b901433eac5bad60dde70f7358870adde2 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:09:27 +0100 Subject: [PATCH 09/11] Update to latest barrier commit --- cabal.project | 2 +- stack.yaml | 2 +- stack.yaml.lock | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cabal.project b/cabal.project index 0378671..0e83240 100644 --- a/cabal.project +++ b/cabal.project @@ -3,4 +3,4 @@ packages: . source-repository-package type: git location: https://github.com/PureFunctor/barrier.git - tag: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 + tag: db5e27c8ff8f98b2ea18036ce20f853a92aec595 diff --git a/stack.yaml b/stack.yaml index 8c2a530..570e97b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -8,7 +8,7 @@ packages: extra-deps: - git: https://github.com/PureFunctor/barrier.git - commit: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 + commit: db5e27c8ff8f98b2ea18036ce20f853a92aec595 - bytestring-trie-0.2.7@sha256:f78e9d1dba699ce56080824693787918e9e8904db99d04d3470941420b1dd3ed,9010 - classy-prelude-yesod-1.5.0 - language-javascript-0.7.0.0 diff --git a/stack.yaml.lock b/stack.yaml.lock index 95e04b1..dceb303 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -10,11 +10,11 @@ packages: git: https://github.com/PureFunctor/barrier.git pantry-tree: size: 1892 - sha256: c87d5adc48b644c76a4a07f31a98da6233f0ba5c2a386443e1ed2ec2261596c5 - commit: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 + sha256: b7d15fa12674068618745c2cbdaa6d0fa256206d0904d4e8964606ee7fd57676 + commit: db5e27c8ff8f98b2ea18036ce20f853a92aec595 original: git: https://github.com/PureFunctor/barrier.git - commit: 79e8fc36fb7d36591f9f65c0e0eb892d8062cdc5 + commit: db5e27c8ff8f98b2ea18036ce20f853a92aec595 - completed: hackage: bytestring-trie-0.2.7@sha256:f78e9d1dba699ce56080824693787918e9e8904db99d04d3470941420b1dd3ed,9010 pantry-tree: From 484ba9057c5b9fb4febb028c4ca831f1ebfa0f96 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Tue, 30 Aug 2022 08:04:54 +0100 Subject: [PATCH 10/11] Fix imports for ci pipeline --- src/Foundation.hs | 4 ++-- src/GithubAPI.hs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index dcca74c..a681a4c 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -13,10 +13,10 @@ import qualified Text.Blaze.Html.Renderer.Text as Blaze import Text.Hamlet (hamletFile) import Text.Jasmine (minifym) import Text.Julius (rawJS) -import Yesod.Core.Types (Logger) +import Yesod.Core.Types + ( Logger, HandlerData, rheSite, handlerEnv ) import Yesod.EmbeddedStatic (EmbeddedStatic, embedStaticContent) import qualified Yesod.Core.Unsafe as Unsafe -import Yesod.Core.Types (HandlerData, rheSite, handlerEnv) import Web.Bower.PackageMeta (PackageName, parsePackageName, runPackageName) import Data.Version diff --git a/src/GithubAPI.hs b/src/GithubAPI.hs index 06c39fc..5f0b804 100644 --- a/src/GithubAPI.hs +++ b/src/GithubAPI.hs @@ -10,7 +10,6 @@ import Text.Blaze.Html (preEscapedToHtml) import qualified Data.ByteString.Lazy as BL import qualified Data.Aeson as A import qualified Data.Aeson.KeyMap as KM -import qualified Data.HashMap.Strict as HashMap import qualified Data.CaseInsensitive as CI import Text.HTML.SanitizeXSS (sanitize) import Data.CaseInsensitive (CI) From 7fe4f156bd48ccf9faef4edaecfa237fdc38965e Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:51:47 +0100 Subject: [PATCH 11/11] Fix deprecation error --- src/TemplateHelpers.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/TemplateHelpers.hs b/src/TemplateHelpers.hs index 97a75fe..a9f608a 100644 --- a/src/TemplateHelpers.hs +++ b/src/TemplateHelpers.hs @@ -6,7 +6,6 @@ import qualified Data.Map as Map import Data.Version (Version) import Data.List (nub) import Data.Text (splitOn) -import Data.Time.Format as TimeFormat import Text.Blaze.Html5 as H hiding (map, link) import Text.Blaze.Html5.Attributes as A hiding (span, name, start, for) import qualified Web.Bower.PackageMeta as Bower @@ -17,6 +16,7 @@ import Handler.Database (lookupPackage) import GithubAPI (ReadmeMissing(..)) import qualified GithubAPI +import qualified Data.Time.Format.ISO8601 as ISO8601 linkToGithubUser :: D.GithubUser -> Html linkToGithubUser user = @@ -271,7 +271,4 @@ getFragmentRender = do return $ \(route, fragment) -> render route ++ maybe "" ("#" ++) fragment formatDate :: UTCTime -> String -formatDate = - TimeFormat.formatTime - TimeFormat.defaultTimeLocale - (TimeFormat.iso8601DateFormat Nothing) +formatDate = ISO8601.iso8601Show