From 30b3709a92c5d4e8c13cfb8f5d782b74079b0e09 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Sun, 2 Jun 2024 23:12:36 -0500 Subject: [PATCH 01/11] add theme config that doesn't do anything yet --- src/Config.idr | 3 +++ src/Data/Config.idr | 38 ++++++++++++++++++++++++++++++--- src/Language/JSON/Accessors.idr | 7 ++++++ 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/Config.idr b/src/Config.idr index 6041a96..d5dfc86 100644 --- a/src/Config.idr +++ b/src/Config.idr @@ -131,6 +131,7 @@ propSetter RequestUsers = update parseBool (\b => { requestUsers := b }) propSetter CommentOnRequest = update parseBool (\b => { commentOnRequest := b }) propSetter DefaultRemote = update Just (\s => { defaultRemote := s }) propSetter MainBranch = update Just (\s => { mainBranch := s }) +propSetter ThemeProp = update parseString (\t => { theme := Just t }) propSetter GithubPAT = update Just (\s => { githubPAT := Just $ hide s }) propSetter AssignTeams = update parseBool (\b => { requestTeams := b }) propSetter AssignUsers = update parseBool (\b => { requestUsers := b }) @@ -156,6 +157,7 @@ propGetter RequestUsers = show . requestUsers propGetter CommentOnRequest = show . commentOnRequest propGetter DefaultRemote = show . defaultRemote propGetter MainBranch = show . mainBranch +propGetter ThemeProp = show . theme propGetter GithubPAT = maybe "Not set (will use $GITHUB_PAT environment variable)" show . githubPAT propGetter AssignTeams = show . requestTeams propGetter AssignUsers = show . requestUsers @@ -260,6 +262,7 @@ createConfig envGithubPAT terminalColors terminalColumns editor = do , orgMembers , ignoredPRs = [] , githubPAT = hide <$> configPAT + , theme = Just Dark , ephemeral } ignore $ writeConfig config diff --git a/src/Data/Config.idr b/src/Data/Config.idr index fbf22fe..9bfba3f 100644 --- a/src/Data/Config.idr +++ b/src/Data/Config.idr @@ -50,6 +50,22 @@ export Show (Hidden a) where show _ = "xxxxxxxx (hidden)" +public export +data Theme = Light + | Dark +-- | None + +export +Show Theme where + show Light = "light" + show Dark = "dark" + +export +parseString : String -> Maybe Theme +parseString "light" = Just Light +parseString "dark" = Just Dark +parseString _ = Nothing + public export record Config where constructor MkConfig @@ -82,6 +98,9 @@ record Config where ||| either the environment variable or this config property ||| must be set. githubPAT : Maybe (Hidden String) + ||| Should Harmony print with colors fit for a dark terminal + ||| or a light terminal? + theme : Maybe Theme ||| Configuration properties that are not written to a file. ephemeral : Ephemeral -- not written out to file @@ -110,9 +129,12 @@ data SettableProp : (name : String) -> (help : String) -> Type where DefaultRemote : SettableProp "defaultRemote" "[string] The name of the default Git remote to use (e.g. 'origin')." - MainBranch : SettableProp + MainBranch : SettableProp "mainBranch" "[string] The name of the default Git base branch for new PRs." + ThemeProp : SettableProp + "theme" + "[dark/light]" GithubPAT : SettableProp "githubPAT" """ @@ -149,6 +171,7 @@ settablePropNamed "requestTeams" = Just $ Evidence _ RequestTeams settablePropNamed "commentOnRequest" = Just $ Evidence _ CommentOnRequest settablePropNamed "defaultRemote" = Just $ Evidence _ DefaultRemote settablePropNamed "mainBranch" = Just $ Evidence _ MainBranch +settablePropNamed "theme" = Just $ Evidence _ ThemeProp settablePropNamed "githubPAT" = Just $ Evidence _ GithubPAT settablePropNamed "requestUsers" = Just $ Evidence _ RequestUsers settablePropNamed "assignTeams" = Just $ Evidence _ AssignTeams @@ -171,6 +194,7 @@ settableProps = [ , (_ ** _ ** CommentOnRequest) , (_ ** _ ** DefaultRemote) , (_ ** _ ** MainBranch) + , (_ ** _ ** ThemeProp) , (_ ** _ ** GithubPAT) , (_ ** _ ** AssignUsers) , (_ ** _ ** AssignTeams) @@ -231,6 +255,7 @@ export Show Config where show config = unlines [ " updatedAt: \{show config.updatedAt}" + , " theme: \{show config.theme}" , " org: \{show config.org}" , " repo: \{show config.repo}" , " defaultRemote: \{show config.defaultRemote}" @@ -254,8 +279,9 @@ Show Config where export json : Config -> JSON -json (MkConfig updatedAt org repo defaultRemote mainBranch requestTeams requestUsers commentOnRequest - teamSlugs repoLabels orgMembers ignoredPRs githubPAT _) = +json (MkConfig updatedAt org repo defaultRemote mainBranch + requestTeams requestUsers commentOnRequest teamSlugs + repoLabels orgMembers ignoredPRs githubPAT theme _) = JObject [ ("requestTeams" , JBool requestTeams) , ("requestUsers" , JBool requestUsers) @@ -264,6 +290,7 @@ json (MkConfig updatedAt org repo defaultRemote mainBranch requestTeams requestU , ("repo" , JString repo) , ("defaultRemote" , JString defaultRemote) , ("mainBranch" , JString mainBranch) + , ("theme" , JString $ show theme) , ("orgMembers" , JArray $ JString <$> sort orgMembers) , ("teamSlugs" , JArray $ JString <$> sort teamSlugs) , ("repoLabels" , JArray $ JString <$> sort repoLabels) @@ -308,6 +335,7 @@ parseConfig ephemeral = (mapFst (const "Failed to parse JSON") . parseJSON Virtu requestUsers <- exactlyOneOf "assignUsers" "requestUsers" commentOnRequest <- exactlyOneOf "commentOnAssign" "commentOnRequest" let maybeGithubPAT = lookup "githubPAT" config + let maybeTheme = lookup "theme" config ua <- cast <$> integer updatedAt o <- string org r <- string repo @@ -321,6 +349,9 @@ parseConfig ephemeral = (mapFst (const "Failed to parse JSON") . parseJSON Virtu om <- array string orgMembers ip <- array integer ignoredPRs gp <- maybe (Right Nothing) (optional string) maybeGithubPAT + th <- maybe (Right Nothing) + (optional $ stringy "dark or light" parseString) + maybeTheme pure $ MkConfig { updatedAt = ua , org = o @@ -335,6 +366,7 @@ parseConfig ephemeral = (mapFst (const "Failed to parse JSON") . parseJSON Virtu , orgMembers = om , ignoredPRs = ip , githubPAT = (map Hide) gp + , theme = th , ephemeral = ephemeral } where diff --git a/src/Language/JSON/Accessors.idr b/src/Language/JSON/Accessors.idr index f6bbec5..942af6d 100644 --- a/src/Language/JSON/Accessors.idr +++ b/src/Language/JSON/Accessors.idr @@ -30,6 +30,13 @@ string : JSON -> Either String String string (JString x) = Right x string json = Left "Expected a string but found \{show json}." +export +stringy : (desc : String) -> (String -> Maybe a) -> JSON -> Either String a +stringy d f (JString x) = case f x of + (Just y) => Right y + Nothing => Left "Expected \{d} but found \{show x}." +stringy d f json = Left "Expected a string but found \{show json}." + export integer : JSON -> Either String Integer integer (JInteger x) = Right $ cast x From cc5462ecd6a56e1f5efe2c42484636feee8ec13b Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Mon, 24 Jun 2024 00:13:46 -0500 Subject: [PATCH 02/11] begin to define colors in terms of theme data type without differentiating light and dark yet. --- src/Config.idr | 1 + src/Data/Config.idr | 17 +---------------- src/Data/Theme.idr | 19 +++++++++++++++++++ src/Graph.idr | 40 +++++++++++++++++++++------------------- src/Theme.idr | 29 +++++++++++++++++++++++++++++ 5 files changed, 71 insertions(+), 35 deletions(-) create mode 100644 src/Data/Theme.idr create mode 100644 src/Theme.idr diff --git a/src/Config.idr b/src/Config.idr index d5dfc86..31f465d 100644 --- a/src/Config.idr +++ b/src/Config.idr @@ -7,6 +7,7 @@ import Data.List.PrefixSuffix import Data.List1 import Data.Promise import Data.String +import Data.Theme import Decidable.Equality import FFI.Git import FFI.GitHub diff --git a/src/Data/Config.idr b/src/Data/Config.idr index 9bfba3f..87d6851 100644 --- a/src/Data/Config.idr +++ b/src/Data/Config.idr @@ -4,6 +4,7 @@ import Data.Either import Data.List import Data.List.Elem import Data.String +import Data.Theme import Data.Vect import JSON.Parser import Language.JSON.Accessors @@ -50,22 +51,6 @@ export Show (Hidden a) where show _ = "xxxxxxxx (hidden)" -public export -data Theme = Light - | Dark --- | None - -export -Show Theme where - show Light = "light" - show Dark = "dark" - -export -parseString : String -> Maybe Theme -parseString "light" = Just Light -parseString "dark" = Just Dark -parseString _ = Nothing - public export record Config where constructor MkConfig diff --git a/src/Data/Theme.idr b/src/Data/Theme.idr new file mode 100644 index 0000000..ae6943c --- /dev/null +++ b/src/Data/Theme.idr @@ -0,0 +1,19 @@ +module Data.Theme + +%default total + +public export +data Theme = Light + | Dark +-- | None + +export +Show Theme where + show Light = "light" + show Dark = "dark" + +export +parseString : String -> Maybe Theme +parseString "light" = Just Light +parseString "dark" = Just Dark +parseString _ = Nothing diff --git a/src/Graph.idr b/src/Graph.idr index 38bb02c..db46ac3 100644 --- a/src/Graph.idr +++ b/src/Graph.idr @@ -5,6 +5,7 @@ import Data.List import Data.ReviewScore import Data.SortedMap import Data.Nat +import Theme import Data.Date import Data.PullRequest @@ -16,6 +17,8 @@ import Text.PrettyPrint.Prettyprinter.Util %default total +%hide Terminal.color + interface Graphable g where totalWidth : g -> Nat label : g -> Doc AnsiStyle @@ -43,18 +46,20 @@ record PRsOnDate dateTy where date : dateTy prCount : Nat +-- Make the PR count on each date graphable for the +-- health command's graph. Pretty dateTy => Graphable (PRsOnDate dateTy) where totalWidth g = g.prCount label g = coloredLabel <++> countInParens where coloredLabel : Doc AnsiStyle coloredLabel = if g.prCount == 0 - then (annotate (color Green) $ pretty g.date) + then (annotate (color Good) $ pretty g.date) else if g.prCount < 2 then pretty g.date else if g.prCount < 6 - then (annotate (color Yellow) $ pretty g.date) - else (annotate (color Red) $ pretty g.date) + then (annotate (color NotGreat) $ pretty g.date) + else (annotate (color Bad) $ pretty g.date) countInParens : Doc AnsiStyle countInParens = if g.prCount > 4 @@ -74,9 +79,9 @@ Pretty Date where ||| @ bonus a bonus indicator graphed on the far right in green. bar : (indentation : Nat) -> (score : Nat) -> (detractor : Nat) -> (bonus : Nat) -> Doc AnsiStyle bar idt score detractor bonus = indent (cast idt) . hcat $ - [ annotate (color Red) . hcat $ replicate detractor (pretty '◦') - , annotate (color Yellow) . hcat $ replicate score (pretty '·') - , annotate (color Green) . hcat $ replicate bonus (pretty '▪') + [ annotate (color Missed) . hcat $ replicate detractor (pretty '◦') + , annotate (color Pending) . hcat $ replicate score (pretty '·') + , annotate (color Completed) . hcat $ replicate bonus (pretty '▪') ] graphOne : Graphable g => (highScore : Nat) -> g -> Doc AnsiStyle @@ -137,9 +142,6 @@ healthGraph openPullRequests org repo = placeholder = MkPRsOnDate placeholderDate 0 in unfoldGraph fuel (next :: xs) (Just (placeholderDate, placeholder ::: forget acc)) - yellowDot : Doc AnsiStyle - yellowDot = annotate (color Yellow) "·" - header : Doc AnsiStyle header = vsep $ catMaybes [ Just $ emptyDoc @@ -177,23 +179,23 @@ reviewsGraph closedReviews openReviews candidates completedReviews = , footer ] where - yellowDot : Doc AnsiStyle - yellowDot = annotate (color Yellow) "·" + pendingDot : Doc AnsiStyle + pendingDot = annotate (color Pending) "·" - redDot : Doc AnsiStyle - redDot = annotate (color Red) "◦" + missedDot : Doc AnsiStyle + missedDot = annotate (color Missed) "◦" - greenBox : Doc AnsiStyle - greenBox = annotate (color Green) "▪" + completedBox : Doc AnsiStyle + completedBox = annotate (color Completed) "▪" header : Doc AnsiStyle header = vsep $ catMaybes [ Just $ emptyDoc , Just $ pretty "Weighted review workload." - , Just $ pretty "4x the number of open review requests" <++> parens yellowDot - , Just $ pretty "1x the number of closed PRs with unanswered review requests" <++> parens redDot - , if (null completedReviews) then Nothing else Just $ pretty "1x the number of completed reviews" <++> parens greenBox - , Just $ parens $ redDot <++> pretty "overlayed on" <++> yellowDot + , Just $ pretty "4x the number of open review requests" <++> parens pendingDot + , Just $ pretty "1x the number of closed PRs with unanswered review requests" <++> parens missedDot + , if (null completedReviews) then Nothing else Just $ pretty "1x the number of completed reviews" <++> parens completedBox + , Just $ parens $ missedDot <++> pretty "overlayed on" <++> pendingDot , Just $ emptyDoc ] diff --git a/src/Theme.idr b/src/Theme.idr new file mode 100644 index 0000000..04713cd --- /dev/null +++ b/src/Theme.idr @@ -0,0 +1,29 @@ +module Theme + +import Data.Theme +import Text.PrettyPrint.Prettyprinter.Render.Terminal + +%default total + +public export +data SemanticColor = Good + | NotGreat + | Bad + | Completed + | Pending + | Missed + +%inline +public export +color : SemanticColor -> AnsiStyle +color = Terminal.color . go + where + go : SemanticColor -> Color + go Good = Green + go NotGreat = Yellow + go Bad = Red + + go Completed = Green + go Pending = Yellow + go Missed = Red + From 24d7b25665da5eed908c0bf3145a503815d78ad0 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Tue, 25 Jun 2024 10:02:12 -0500 Subject: [PATCH 03/11] expand theme code to support background colors. choose black over yellow for visibility on light backgrounds --- src/Commands.idr | 2 +- src/Config.idr | 2 +- src/Data/Config.idr | 6 +-- src/Graph.idr | 119 ++++++++++++++++++++++---------------------- src/Theme.idr | 52 ++++++++++++------- 5 files changed, 99 insertions(+), 82 deletions(-) diff --git a/src/Commands.idr b/src/Commands.idr index 7dfef3d..01b13fe 100644 --- a/src/Commands.idr +++ b/src/Commands.idr @@ -207,7 +207,7 @@ health @{config} = do (<||>) : Alternative t => (a -> t b) -> (a -> t b) -> a -> t b (<||>) f g x = f x <|> g x -infixr 2 <||> +private infixr 2 <||> ||| Parse arguments for the graph command. export diff --git a/src/Config.idr b/src/Config.idr index 31f465d..54e71d9 100644 --- a/src/Config.idr +++ b/src/Config.idr @@ -158,7 +158,7 @@ propGetter RequestUsers = show . requestUsers propGetter CommentOnRequest = show . commentOnRequest propGetter DefaultRemote = show . defaultRemote propGetter MainBranch = show . mainBranch -propGetter ThemeProp = show . theme +propGetter ThemeProp = show . maybe Dark id . theme propGetter GithubPAT = maybe "Not set (will use $GITHUB_PAT environment variable)" show . githubPAT propGetter AssignTeams = show . requestTeams propGetter AssignUsers = show . requestUsers diff --git a/src/Data/Config.idr b/src/Data/Config.idr index 87d6851..ebcf50c 100644 --- a/src/Data/Config.idr +++ b/src/Data/Config.idr @@ -240,7 +240,7 @@ export Show Config where show config = unlines [ " updatedAt: \{show config.updatedAt}" - , " theme: \{show config.theme}" + , " theme: \{show $ maybe Dark id config.theme}" , " org: \{show config.org}" , " repo: \{show config.repo}" , " defaultRemote: \{show config.defaultRemote}" @@ -275,7 +275,7 @@ json (MkConfig updatedAt org repo defaultRemote mainBranch , ("repo" , JString repo) , ("defaultRemote" , JString defaultRemote) , ("mainBranch" , JString mainBranch) - , ("theme" , JString $ show theme) + , ("theme" , JString . show $ maybe Dark id theme) , ("orgMembers" , JArray $ JString <$> sort orgMembers) , ("teamSlugs" , JArray $ JString <$> sort teamSlugs) , ("repoLabels" , JArray $ JString <$> sort repoLabels) @@ -334,7 +334,7 @@ parseConfig ephemeral = (mapFst (const "Failed to parse JSON") . parseJSON Virtu om <- array string orgMembers ip <- array integer ignoredPRs gp <- maybe (Right Nothing) (optional string) maybeGithubPAT - th <- maybe (Right Nothing) + th <- maybe (Right $ Just Dark) (optional $ stringy "dark or light" parseString) maybeTheme pure $ MkConfig { diff --git a/src/Graph.idr b/src/Graph.idr index db46ac3..ea6eaca 100644 --- a/src/Graph.idr +++ b/src/Graph.idr @@ -1,5 +1,6 @@ module Graph +import Data.Config import Data.Fuel import Data.List import Data.ReviewScore @@ -17,8 +18,6 @@ import Text.PrettyPrint.Prettyprinter.Util %default total -%hide Terminal.color - interface Graphable g where totalWidth : g -> Nat label : g -> Doc AnsiStyle @@ -46,69 +45,71 @@ record PRsOnDate dateTy where date : dateTy prCount : Nat --- Make the PR count on each date graphable for the --- health command's graph. -Pretty dateTy => Graphable (PRsOnDate dateTy) where - totalWidth g = g.prCount - label g = coloredLabel <++> countInParens - where - coloredLabel : Doc AnsiStyle - coloredLabel = if g.prCount == 0 - then (annotate (color Good) $ pretty g.date) - else if g.prCount < 2 - then pretty g.date - else if g.prCount < 6 - then (annotate (color NotGreat) $ pretty g.date) - else (annotate (color Bad) $ pretty g.date) - - countInParens : Doc AnsiStyle - countInParens = if g.prCount > 4 - then (annotate italic $ pretty "(\{show g.prCount})") - else pretty "" - score g = g.prCount - detractor _ = 0 - bonus _ = 0 - Pretty Date where pretty = pretty . showYearAndMonth -||| Graph a single line (bar) of dots. -||| @ indentation a number of leading spaces to product off to the left (uses Doc's @indent@) -||| @ score the net score to graph out in yellow. -||| @ detractor the amount detracting from the score, graphed in red. -||| @ bonus a bonus indicator graphed on the far right in green. -bar : (indentation : Nat) -> (score : Nat) -> (detractor : Nat) -> (bonus : Nat) -> Doc AnsiStyle -bar idt score detractor bonus = indent (cast idt) . hcat $ - [ annotate (color Missed) . hcat $ replicate detractor (pretty '◦') - , annotate (color Pending) . hcat $ replicate score (pretty '·') - , annotate (color Completed) . hcat $ replicate bonus (pretty '▪') - ] - -graphOne : Graphable g => (highScore : Nat) -> g -> Doc AnsiStyle -graphOne highScore x = - -- we create a bar with the combinedScore and then fill in any - -- remaining space with an indication of the detractor. We cap - -- the detractor representation at the high score to make everything - -- line up nicely. The detractor is just there to give some indication - -- of review requests that did not count positively toward the score. - let idt = highScore `minus` (totalWidth x) - remainingSpace = highScore `minus` (score x) - in bar idt (score x) (min remainingSpace (detractor x)) (bonus x) <++> (label x) - -graph : Graphable g => (highScore : Nat) -> List g -> Doc AnsiStyle -graph highScore = vsep . map (graphOne highScore) +parameters (config : Config) + -- Make the PR count on each date graphable for the + -- health command's graph. + Pretty dateTy => Graphable (PRsOnDate dateTy) where + totalWidth g = g.prCount + label g = coloredLabel <++> countInParens + where + coloredLabel : Doc AnsiStyle + coloredLabel = if g.prCount == 0 + then (theme Good $ pretty g.date) + else if g.prCount < 2 + then pretty g.date + else if g.prCount < 6 + then (theme NotGreat $ pretty g.date) + else (theme Bad $ pretty g.date) + + countInParens : Doc AnsiStyle + countInParens = if g.prCount > 4 + then (annotate italic $ pretty "(\{show g.prCount})") + else pretty "" + score g = g.prCount + detractor _ = 0 + bonus _ = 0 + + ||| Graph a single line (bar) of dots. + ||| @ indentation a number of leading spaces to product off to the left (uses Doc's @indent@) + ||| @ score the net score to graph out in yellow. + ||| @ detractor the amount detracting from the score, graphed in red. + ||| @ bonus a bonus indicator graphed on the far right in green. + bar : (indentation : Nat) -> (score : Nat) -> (detractor : Nat) -> (bonus : Nat) -> Doc AnsiStyle + bar idt score detractor bonus = indent (cast idt) . hcat $ + [ theme Missed . hcat $ replicate detractor (pretty '◦') + , theme Pending . hcat $ replicate score (pretty '·') + , theme Completed . hcat $ replicate bonus (pretty '▪') + ] + + graphOne : Graphable g => (highScore : Nat) -> g -> Doc AnsiStyle + graphOne highScore x = + -- we create a bar with the combinedScore and then fill in any + -- remaining space with an indication of the detractor. We cap + -- the detractor representation at the high score to make everything + -- line up nicely. The detractor is just there to give some indication + -- of review requests that did not count positively toward the score. + let idt = highScore `minus` (totalWidth x) + remainingSpace = highScore `minus` (score x) + in bar idt (score x) (min remainingSpace (detractor x)) (bonus x) <++> (label x) + + graph : Graphable g => (highScore : Nat) -> List g -> Doc AnsiStyle + graph highScore = vsep . map (graphOne highScore) ||| Produce a graph of open pull requests per month (by the month the PR was created). export -healthGraph : (openPullRequests : List PullRequest) +healthGraph : Config => + (openPullRequests : List PullRequest) -> (org : String) -> (repo : String) -> Doc AnsiStyle -healthGraph openPullRequests org repo = +healthGraph @{config} openPullRequests org repo = let groups = groupBy ((==) `on` .month `on` .createdAt) $ sortBy (compare `on` .createdAt) openPullRequests max = foldr (\xs,m => max (length xs) m) 1 groups in vsep [ header - , graph max (unfoldGraph (limit 48) groups Nothing) + , graph config max (unfoldGraph (limit 48) groups Nothing) , emptyDoc , pretty link , emptyDoc @@ -157,13 +158,13 @@ healthGraph openPullRequests org repo = ||| @ completedReviews Optionally pass a map from login to count of completed reviews to ||| graph as well. export -reviewsGraph : Ord login => Pretty login => +reviewsGraph : Config => Ord login => Pretty login => (closedReviews : List login) -> (openReviews : List login) -> (candidates : List login) -> (completedReviews : Maybe (SortedMap login Nat)) -> Doc AnsiStyle -reviewsGraph closedReviews openReviews candidates completedReviews = +reviewsGraph @{config} closedReviews openReviews candidates completedReviews = let scoredOptions = reverse $ scoredReviewers closedReviews openReviews (sort $ nub candidates) augmentedOptions : List (AugmentedReviewScore login) = case completedReviews of @@ -175,18 +176,18 @@ reviewsGraph closedReviews openReviews candidates completedReviews = ((MkScore _ s c) :: _) => let highScore = c + (s `minus` c) + maxBonus in vsep [ header - , graph (if highScore > 0 then highScore else 1) augmentedOptions + , graph config (if highScore > 0 then highScore else 1) augmentedOptions , footer ] where pendingDot : Doc AnsiStyle - pendingDot = annotate (color Pending) "·" + pendingDot = theme Pending $ pretty "·" missedDot : Doc AnsiStyle - missedDot = annotate (color Missed) "◦" + missedDot = theme Missed $ pretty "◦" completedBox : Doc AnsiStyle - completedBox = annotate (color Completed) "▪" + completedBox = theme Completed $ pretty "▪" header : Doc AnsiStyle header = vsep $ diff --git a/src/Theme.idr b/src/Theme.idr index 04713cd..f0a764a 100644 --- a/src/Theme.idr +++ b/src/Theme.idr @@ -1,29 +1,45 @@ module Theme +import Data.Config import Data.Theme +import Text.PrettyPrint.Prettyprinter import Text.PrettyPrint.Prettyprinter.Render.Terminal %default total +record Colors where + constructor MkCs + foreground : Maybe Color + background : Maybe Color + +cs : List Color -> Colors +cs [foreground] = MkCs (Just foreground) Nothing +cs [foreground, background] = MkCs (Just foreground) (Just background) +cs _ = MkCs Nothing Nothing + public export -data SemanticColor = Good - | NotGreat - | Bad - | Completed - | Pending - | Missed - -%inline +data SemanticColor : Colors -> Colors -> Type where + Good : SemanticColor (cs [Green ]) (cs [Green]) + NotGreat : SemanticColor (cs [Yellow]) (cs [Black]) + Bad : SemanticColor (cs [Red ]) (cs [Red]) + Completed : SemanticColor (cs [Green ]) (cs [Green]) + Pending : SemanticColor (cs [Yellow]) (cs [Black]) + Missed : SemanticColor (cs [Red ]) (cs [Red]) + public export -color : SemanticColor -> AnsiStyle -color = Terminal.color . go +theme : Config => {d, l : _} -> SemanticColor d l -> Doc AnsiStyle -> Doc AnsiStyle +theme @{config} = go configTheme where - go : SemanticColor -> Color - go Good = Green - go NotGreat = Yellow - go Bad = Red - - go Completed = Green - go Pending = Yellow - go Missed = Red + configTheme : Theme + configTheme = maybe Dark id config.theme + + maybeAnnotate : (Color -> AnsiStyle) -> Maybe Color -> Doc AnsiStyle -> Doc AnsiStyle + maybeAnnotate s c = maybe id (annotate . s) c + + colorsAnn : Colors -> Doc AnsiStyle -> Doc AnsiStyle + colorsAnn (MkCs fg bg) = maybeAnnotate color fg . maybeAnnotate bgColor bg + + go : Theme -> {dark, light : _} -> SemanticColor dark light -> Doc AnsiStyle -> Doc AnsiStyle + go Dark _ = colorsAnn dark + go Light _ = colorsAnn light From d9f9e40d0c6abdfcfebd3f871c00908c1113fddd Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Sat, 29 Jun 2024 22:44:50 -0500 Subject: [PATCH 04/11] Add theme config property to expected help output --- test/expected_help.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/expected_help.txt b/test/expected_help.txt index dc4a4c4..89c1408 100644 --- a/test/expected_help.txt +++ b/test/expected_help.txt @@ -9,7 +9,7 @@ Subcommands: Get or set the value of a configuration property. Not all properties can be set and read via this subcommand. properties: requestTeams, requestUsers, commentOnRequest, defaultRemote, - mainBranch, githubPAT, assignUsers, assignTeams, + mainBranch, theme, githubPAT, assignUsers, assignTeams, commentOnAssign contribute [-c/--checkout] [-] [-i/--ignore {/}] Contribute to an open PR. Prints a URL. Prioritizes PRs you are requested From 20799240729279cc6d04137c6c1eed62fa8aa49e Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Sat, 29 Jun 2024 23:16:38 -0500 Subject: [PATCH 05/11] Apply theme color choices to reflect command output --- src/Graph.idr | 2 +- src/Theme.idr | 18 ++++++++++++------ src/User.idr | 41 ++++++++++++++++++++++------------------- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/Graph.idr b/src/Graph.idr index ea6eaca..8f95b27 100644 --- a/src/Graph.idr +++ b/src/Graph.idr @@ -80,7 +80,7 @@ parameters (config : Config) bar : (indentation : Nat) -> (score : Nat) -> (detractor : Nat) -> (bonus : Nat) -> Doc AnsiStyle bar idt score detractor bonus = indent (cast idt) . hcat $ [ theme Missed . hcat $ replicate detractor (pretty '◦') - , theme Pending . hcat $ replicate score (pretty '·') + , theme Pending' . hcat $ replicate score (pretty '·') , theme Completed . hcat $ replicate bonus (pretty '▪') ] diff --git a/src/Theme.idr b/src/Theme.idr index f0a764a..9c90dd8 100644 --- a/src/Theme.idr +++ b/src/Theme.idr @@ -17,14 +17,20 @@ cs [foreground] = MkCs (Just foreground) Nothing cs [foreground, background] = MkCs (Just foreground) (Just background) cs _ = MkCs Nothing Nothing +||| The prime variants where they exist are for situations where the +||| character being drawn is small so a different color choice might +||| be useful for visibility. public export data SemanticColor : Colors -> Colors -> Type where - Good : SemanticColor (cs [Green ]) (cs [Green]) - NotGreat : SemanticColor (cs [Yellow]) (cs [Black]) - Bad : SemanticColor (cs [Red ]) (cs [Red]) - Completed : SemanticColor (cs [Green ]) (cs [Green]) - Pending : SemanticColor (cs [Yellow]) (cs [Black]) - Missed : SemanticColor (cs [Red ]) (cs [Red]) + Good : SemanticColor (cs [Green ]) (cs [Green]) + NotGreat : SemanticColor (cs [Yellow]) (cs [Black]) + Bad : SemanticColor (cs [Red ]) (cs [Red]) + Completed : SemanticColor (cs [Green ]) (cs [Green]) + Completed' : SemanticColor (cs [Green ]) (cs [Black]) + Pending : SemanticColor (cs [Yellow]) (cs [Yellow]) + Pending' : SemanticColor (cs [Yellow]) (cs [Black]) + Missed : SemanticColor (cs [Red ]) (cs [Red]) + Data : SemanticColor (cs [Green ]) (cs [Blue]) public export theme : Config => {d, l : _} -> SemanticColor d l -> Doc AnsiStyle -> Doc AnsiStyle diff --git a/src/User.idr b/src/User.idr index 83b062d..b21b520 100644 --- a/src/User.idr +++ b/src/User.idr @@ -11,6 +11,7 @@ import Data.User import FFI.Git import FFI.GitHub import PullRequest +import Theme import Util import Text.PrettyPrint.Prettyprinter @@ -18,9 +19,9 @@ import Text.PrettyPrint.Prettyprinter.Render.Terminal %default total -replicate' : Color -> Nat -> Char -> Doc AnsiStyle +replicate' : Config => {d,l : _} -> SemanticColor d l -> Nat -> Char -> Doc AnsiStyle replicate' c n char = - annotate (color c) (pretty $ String.replicate n char) + theme c . pretty $ String.replicate n char namespace Reflect prCount : Fin 101 @@ -48,18 +49,19 @@ namespace Reflect intro = "Your current pull request summary (out of the past \{show prCount} PRs):" parameters (pageWidth : Nat, reviews : Nat, openReq : Nat, closedReq : Nat, closedAuth : Nat, openAuth : Nat) - chart : (leftPadding : Nat) + chart : Config => + (leftPadding : Nat) -> Doc AnsiStyle chart leftPadding = indent (cast leftPadding) $ - replicate' Green reviews '·' - <+> replicate' Red closedReq '◦' - <+> replicate' Yellow openReq '<' + replicate' Completed' reviews '·' + <+> replicate' Missed closedReq '◦' + <+> replicate' Pending openReq '<' <++> pretty "|" - <++> replicate' Yellow openAuth '>' - <+> replicate' Green closedAuth '·' + <++> replicate' Pending openAuth '>' + <+> replicate' Completed' closedAuth '·' - graph : Doc AnsiStyle + graph : Config => Doc AnsiStyle graph = let req = openReq + closedReq auth = openAuth + closedAuth @@ -99,7 +101,7 @@ namespace Reflect , annotate italic $ pretty "*review count (not PR count) of most recent \{show reviewDetailsCount} PRs." ] - print : Doc AnsiStyle + print : Config => Doc AnsiStyle print = vsep [ emptyDoc , graph @@ -138,11 +140,12 @@ namespace Reflect earliestOpenReq namespace Me - print : (gitEmail : Maybe String) + print : Config + -> (gitEmail : Maybe String) -> (githubUser : User) -> (githubTeams : List String) -> Doc AnsiStyle - print gitEmail githubUser githubTeams = + print config gitEmail githubUser githubTeams = vsep [ emptyDoc , email @@ -160,19 +163,19 @@ namespace Me it : String -> Doc AnsiStyle it = annotate italic . pretty - green : String -> Doc AnsiStyle - green = annotate (color Green) . pretty + dataVal : String -> Doc AnsiStyle + dataVal = theme Data . pretty email : Doc AnsiStyle email = "Git Email:" <++> case gitEmail of - Just e => green e + Just e => dataVal e Nothing => it "Not set" fullName : Doc AnsiStyle - fullName = "GitHub Name:" <++> green githubUser.name + fullName = "GitHub Name:" <++> dataVal githubUser.name login : Doc AnsiStyle - login = "GitHub Login:" <++> green githubUser.login + login = "GitHub Login:" <++> dataVal githubUser.login teams : Doc AnsiStyle teams = vsep $ @@ -184,11 +187,11 @@ namespace Me export printInfoOnSelf : Config => Octokit => Git => Promise () - printInfoOnSelf = do + printInfoOnSelf @{config} = do gitEmail <- handleUnsetEmail <$> userEmail githubUser <- getSelf githubTeams <- sort <$> listMyTeams - renderIO $ print gitEmail githubUser githubTeams + renderIO $ print config gitEmail githubUser githubTeams where handleUnsetEmail : String -> Maybe String handleUnsetEmail "" = Nothing From 116b3a8e787065f7eff664e81d32d33200ed95bd Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Sat, 29 Jun 2024 23:19:24 -0500 Subject: [PATCH 06/11] Add TODO for making theme non-optional in config after next major release --- src/Data/Config.idr | 1 + src/Data/Theme.idr | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Config.idr b/src/Data/Config.idr index ebcf50c..6d5bab1 100644 --- a/src/Data/Config.idr +++ b/src/Data/Config.idr @@ -334,6 +334,7 @@ parseConfig ephemeral = (mapFst (const "Failed to parse JSON") . parseJSON Virtu om <- array string orgMembers ip <- array integer ignoredPRs gp <- maybe (Right Nothing) (optional string) maybeGithubPAT + -- TODO 5.0.0: Make theme required part of config file (default to dark still) th <- maybe (Right $ Just Dark) (optional $ stringy "dark or light" parseString) maybeTheme diff --git a/src/Data/Theme.idr b/src/Data/Theme.idr index ae6943c..5bf01b5 100644 --- a/src/Data/Theme.idr +++ b/src/Data/Theme.idr @@ -5,7 +5,6 @@ module Data.Theme public export data Theme = Light | Dark --- | None export Show Theme where From 4b186b5f63c705338bd91c1a0cdb34ca71232a58 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Sat, 29 Jun 2024 23:26:15 -0500 Subject: [PATCH 07/11] decide that theme does not need to be optional in the config data type --- src/Config.idr | 6 +++--- src/Data/Config.idr | 11 ++++++----- src/Theme.idr | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Config.idr b/src/Config.idr index 54e71d9..32220ae 100644 --- a/src/Config.idr +++ b/src/Config.idr @@ -132,7 +132,7 @@ propSetter RequestUsers = update parseBool (\b => { requestUsers := b }) propSetter CommentOnRequest = update parseBool (\b => { commentOnRequest := b }) propSetter DefaultRemote = update Just (\s => { defaultRemote := s }) propSetter MainBranch = update Just (\s => { mainBranch := s }) -propSetter ThemeProp = update parseString (\t => { theme := Just t }) +propSetter ThemeProp = update parseString (\t => { theme := t }) propSetter GithubPAT = update Just (\s => { githubPAT := Just $ hide s }) propSetter AssignTeams = update parseBool (\b => { requestTeams := b }) propSetter AssignUsers = update parseBool (\b => { requestUsers := b }) @@ -158,7 +158,7 @@ propGetter RequestUsers = show . requestUsers propGetter CommentOnRequest = show . commentOnRequest propGetter DefaultRemote = show . defaultRemote propGetter MainBranch = show . mainBranch -propGetter ThemeProp = show . maybe Dark id . theme +propGetter ThemeProp = show . theme propGetter GithubPAT = maybe "Not set (will use $GITHUB_PAT environment variable)" show . githubPAT propGetter AssignTeams = show . requestTeams propGetter AssignUsers = show . requestUsers @@ -263,7 +263,7 @@ createConfig envGithubPAT terminalColors terminalColumns editor = do , orgMembers , ignoredPRs = [] , githubPAT = hide <$> configPAT - , theme = Just Dark + , theme = Dark , ephemeral } ignore $ writeConfig config diff --git a/src/Data/Config.idr b/src/Data/Config.idr index 6d5bab1..961a452 100644 --- a/src/Data/Config.idr +++ b/src/Data/Config.idr @@ -85,7 +85,7 @@ record Config where githubPAT : Maybe (Hidden String) ||| Should Harmony print with colors fit for a dark terminal ||| or a light terminal? - theme : Maybe Theme + theme : Theme ||| Configuration properties that are not written to a file. ephemeral : Ephemeral -- not written out to file @@ -240,7 +240,7 @@ export Show Config where show config = unlines [ " updatedAt: \{show config.updatedAt}" - , " theme: \{show $ maybe Dark id config.theme}" + , " theme: \{show config.theme}" , " org: \{show config.org}" , " repo: \{show config.repo}" , " defaultRemote: \{show config.defaultRemote}" @@ -275,7 +275,7 @@ json (MkConfig updatedAt org repo defaultRemote mainBranch , ("repo" , JString repo) , ("defaultRemote" , JString defaultRemote) , ("mainBranch" , JString mainBranch) - , ("theme" , JString . show $ maybe Dark id theme) + , ("theme" , JString $ show theme) , ("orgMembers" , JArray $ JString <$> sort orgMembers) , ("teamSlugs" , JArray $ JString <$> sort teamSlugs) , ("repoLabels" , JArray $ JString <$> sort repoLabels) @@ -335,8 +335,9 @@ parseConfig ephemeral = (mapFst (const "Failed to parse JSON") . parseJSON Virtu ip <- array integer ignoredPRs gp <- maybe (Right Nothing) (optional string) maybeGithubPAT -- TODO 5.0.0: Make theme required part of config file (default to dark still) - th <- maybe (Right $ Just Dark) - (optional $ stringy "dark or light" parseString) + -- theme lookup can be moved to the required lookupAll above. + th <- maybe (Right Dark) + (stringy "dark or light" parseString) maybeTheme pure $ MkConfig { updatedAt = ua diff --git a/src/Theme.idr b/src/Theme.idr index 9c90dd8..517d838 100644 --- a/src/Theme.idr +++ b/src/Theme.idr @@ -37,7 +37,7 @@ theme : Config => {d, l : _} -> SemanticColor d l -> Doc AnsiStyle -> Doc AnsiSt theme @{config} = go configTheme where configTheme : Theme - configTheme = maybe Dark id config.theme + configTheme = config.theme maybeAnnotate : (Color -> AnsiStyle) -> Maybe Color -> Doc AnsiStyle -> Doc AnsiStyle maybeAnnotate s c = maybe id (annotate . s) c From fb0b2e459b0f3c71c08685c6c949fcac04b9ca20 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Sat, 29 Jun 2024 23:28:14 -0500 Subject: [PATCH 08/11] align colors of two dots with the same meaning --- src/Graph.idr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Graph.idr b/src/Graph.idr index 8f95b27..9df05fd 100644 --- a/src/Graph.idr +++ b/src/Graph.idr @@ -181,7 +181,7 @@ reviewsGraph @{config} closedReviews openReviews candidates completedReviews = ] where pendingDot : Doc AnsiStyle - pendingDot = theme Pending $ pretty "·" + pendingDot = theme Pending' $ pretty "·" missedDot : Doc AnsiStyle missedDot = theme Missed $ pretty "◦" From 4363ab09fc67f495ea666c19477407f86f191bfd Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Sun, 30 Jun 2024 10:36:01 -0500 Subject: [PATCH 09/11] Ask for theme preference on first configuration --- src/Config.idr | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Config.idr b/src/Config.idr index 32220ae..b01ceae 100644 --- a/src/Config.idr +++ b/src/Config.idr @@ -236,6 +236,13 @@ createConfig envGithubPAT terminalColors terminalColumns editor = do requestUsers <- yesNoPrompt "Would you like harmony to request reviews from individual users when it requests a teams review?" + let themeDefaultStr = enterForDefaultStr "dark" + putStrLn "Would you like harmony configured for a dark or light terminal background\{themeDefaultStr}?" + theme <- offerRetry "The theme must be either 'dark' or 'light'. Which would you prefer?" + "Could not parse the input as a valid theme; will use 'dark' for now." + Dark $ + Theme.parseString . orIfEmpty (Just "dark") . trim <$> getLine + _ <- liftIO $ octokit pat putStrLn "Creating config..." mainBranch <- getRepoDefaultBranch org repo @@ -263,7 +270,7 @@ createConfig envGithubPAT terminalColors terminalColumns editor = do , orgMembers , ignoredPRs = [] , githubPAT = hide <$> configPAT - , theme = Dark + , theme , ephemeral } ignore $ writeConfig config @@ -272,6 +279,21 @@ createConfig envGithubPAT terminalColors terminalColumns editor = do either renderIO pure (checkConfigConsistency config) pure config where + offerRetry : HasIO io => + (fallbackDescription : String) + -> (failureDescription : String) + -> (fallback : Lazy a) + -> io (Maybe a) + -> io a + offerRetry fallbackDescription failureDescription fallback p = do + Nothing <- p + | Just first => pure first + putStrLn fallbackDescription + Nothing <- p + | Just second => pure second + putStrLn failureDescription + pure fallback + orIfEmpty : Maybe String -> String -> String orIfEmpty Nothing x = x orIfEmpty (Just y) "" = y From 6a6d2a4e0d96df52f387306eb857b1f50411664f Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Sun, 30 Jun 2024 10:50:59 -0500 Subject: [PATCH 10/11] Add theme and some other color related information to the README --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb5d6ba..d2d5fd2 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,10 @@ Would you like harmony to request team reviews in addition to individuals when i Creating config... ``` -Once configured, Harmony supports the following commands: `config`, `branch`, `pr`, `label`, `request`, `contribute`, `whoami`, `reflect`, `list`, `graph`, `health`, and `sync`. +Once configured, Harmony supports the following commands: `config`, `branch`, `pr`, `label`, `request` (also aliased to `rq`), `contribute`, `whoami`, `reflect`, `list`, `graph`, `health`, and `sync`. + +**Note on color output:** +Harmony uses colored output for some commands. You can adjust these colors slightly with the `theme` configuration option. You can also use the `NO_COLOR` environment variable to disable all colored output. Lastly, Harmony will avoid colored output when it determines `stdout` is not a TTY device (as is the case for e.g. redirecting harmony output into a file or piping into `cat`: `harmony ... | cat`). ### Config Running `harmony config ` will read the given configuration property. `harmony config ` will set the configuration property. @@ -119,6 +122,7 @@ Not all configuration properties can be read/set with this command. - `commentOnRequest` (`true`/`false`) -- When requesting a reviewer chosen by Harmony, comment on the pull request. - `defaultRemote` (optional string) -- When pushing new branches, what remote destination should be used. - `mainBranch` (optional string) -- When creating a PR, this is the default base branch. +- `theme` (`dark`/`light`) -- Use colors suited better for either a dark or light Terminal background. - `githubPAT` (optional string) -- If the `$GITHUB_PAT` environment variable is not set, this Personal Access Token is used to authenticate with GitHub. ### Branch From c9ccaa0b7d29e9af01bfaa01d75f1dd2f8c284e7 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Sun, 30 Jun 2024 10:55:13 -0500 Subject: [PATCH 11/11] bump minor version --- default.nix | 2 +- harmony.ipkg | 2 +- node-packages.nix | 52 +++++++++++++++++++++++----------------------- package-lock.json | 36 ++++++++++++++++---------------- package.json | 2 +- src/AppVersion.idr | 2 +- 6 files changed, 48 insertions(+), 48 deletions(-) diff --git a/default.nix b/default.nix index b0002bf..d369f9c 100644 --- a/default.nix +++ b/default.nix @@ -74,7 +74,7 @@ }; harmonyPkg = buildIdris { - version = "4.2.0"; + version = "4.3.0"; ipkgName = "harmony"; src = ./.; diff --git a/harmony.ipkg b/harmony.ipkg index 918ebe4..a9bd4da 100644 --- a/harmony.ipkg +++ b/harmony.ipkg @@ -1,5 +1,5 @@ package harmony -version = 4.2.0 +version = 4.3.0 authors = "Mathew Polzin" license = "MIT" brief = "Harmony GitHub collaboration tool" diff --git a/node-packages.nix b/node-packages.nix index a04c014..e7000ce 100644 --- a/node-packages.nix +++ b/node-packages.nix @@ -279,13 +279,13 @@ sha512 = "FE2V+QZ2UYlh+9wWd5BPLNXG+J/XUD/PPq0ovS+nCcGX4+3qVbi3jYOmCTW48hg9SBBLtInx9+o7fFt4H5iP0Q=="; }; }; - "@types/aws-lambda-8.10.138" = { + "@types/aws-lambda-8.10.140" = { name = "_at_types_slash_aws-lambda"; packageName = "@types/aws-lambda"; - version = "8.10.138"; + version = "8.10.140"; src = fetchurl { - url = "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.138.tgz"; - sha512 = "71EHMl70TPWIAsFuHd85NHq6S6T2OOjiisPTrH7RgcjzpJpPh4RQJv7PvVvIxc6PIp8CLV7F9B+TdjcAES5vcA=="; + url = "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.140.tgz"; + sha512 = "4Dh3dk2TUcbdfHrX0Al90mNGJDvA9NBiTQPzbrjGi/dLxzKCGOYgT8YQ47jUKNFALkAJAadifq0pzyjIUlhVhg=="; }; }; "@types/btoa-lite-1.0.2" = { @@ -306,13 +306,13 @@ sha512 = "/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw=="; }; }; - "@types/node-20.12.13" = { + "@types/node-20.14.9" = { name = "_at_types_slash_node"; packageName = "@types/node"; - version = "20.12.13"; + version = "20.14.9"; src = fetchurl { - url = "https://registry.npmjs.org/@types/node/-/node-20.12.13.tgz"; - sha512 = "gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA=="; + url = "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz"; + sha512 = "06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg=="; }; }; "aggregate-error-3.1.0" = { @@ -369,13 +369,13 @@ sha512 = "4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A=="; }; }; - "debug-4.3.4" = { + "debug-4.3.5" = { name = "debug"; packageName = "debug"; - version = "4.3.4"; + version = "4.3.5"; src = fetchurl { - url = "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz"; - sha512 = "PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ=="; + url = "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz"; + sha512 = "pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg=="; }; }; "deprecation-2.3.1" = { @@ -495,13 +495,13 @@ sha512 = "Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg=="; }; }; - "lru-cache-10.2.2" = { + "lru-cache-10.3.0" = { name = "lru-cache"; packageName = "lru-cache"; - version = "10.2.2"; + version = "10.3.0"; src = fetchurl { - url = "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz"; - sha512 = "9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ=="; + url = "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz"; + sha512 = "CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ=="; }; }; "ms-2.1.2" = { @@ -558,13 +558,13 @@ sha512 = "FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w=="; }; }; - "simple-git-3.24.0" = { + "simple-git-3.25.0" = { name = "simple-git"; packageName = "simple-git"; - version = "3.24.0"; + version = "3.25.0"; src = fetchurl { - url = "https://registry.npmjs.org/simple-git/-/simple-git-3.24.0.tgz"; - sha512 = "QqAKee9Twv+3k8IFOFfPB2hnk6as6Y6ACUpwCtQvRYBAes23Wv3SZlHVobAzqcE8gfsisCvPw3HGW3HYM+VYYw=="; + url = "https://registry.npmjs.org/simple-git/-/simple-git-3.25.0.tgz"; + sha512 = "KIY5sBnzc4yEcJXW7Tdv4viEz8KyG+nU0hay+DWZasvdFOYKeUZ6Xc25LUHHjw0tinPT7O1eY6pzX7pRT1K8rw=="; }; }; "undici-types-5.26.5" = { @@ -607,7 +607,7 @@ args = { name = "_at_mattpolzin_slash_harmony"; packageName = "@mattpolzin/harmony"; - version = "4.2.0"; + version = "4.3.0"; src = ./.; dependencies = [ sources."@kwsites/file-exists-1.1.1" @@ -663,17 +663,17 @@ sources."@octokit/webhooks-12.2.0" sources."@octokit/webhooks-methods-4.1.0" sources."@octokit/webhooks-types-7.4.0" - sources."@types/aws-lambda-8.10.138" + sources."@types/aws-lambda-8.10.140" sources."@types/btoa-lite-1.0.2" sources."@types/jsonwebtoken-9.0.6" - sources."@types/node-20.12.13" + sources."@types/node-20.14.9" sources."aggregate-error-3.1.0" sources."before-after-hook-2.2.3" sources."bottleneck-2.19.5" sources."btoa-lite-1.0.0" sources."buffer-equal-constant-time-1.0.1" sources."clean-stack-2.2.0" - (sources."debug-4.3.4" + (sources."debug-4.3.5" // { dependencies = [ sources."ms-2.1.2" @@ -692,13 +692,13 @@ sources."lodash.isplainobject-4.0.6" sources."lodash.isstring-4.0.1" sources."lodash.once-4.1.1" - sources."lru-cache-10.2.2" + sources."lru-cache-10.3.0" sources."ms-2.1.3" sources."octokit-3.2.1" sources."once-1.4.0" sources."safe-buffer-5.2.1" sources."semver-7.6.2" - sources."simple-git-3.24.0" + sources."simple-git-3.25.0" sources."undici-types-5.26.5" sources."universal-github-app-jwt-1.1.2" sources."universal-user-agent-6.0.1" diff --git a/package-lock.json b/package-lock.json index 1eb3995..b23b48e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mattpolzin/harmony", - "version": "4.2.0", + "version": "4.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mattpolzin/harmony", - "version": "4.2.0", + "version": "4.3.0", "license": "MIT", "dependencies": { "octokit": "^3.1", @@ -422,9 +422,9 @@ "integrity": "sha512-FE2V+QZ2UYlh+9wWd5BPLNXG+J/XUD/PPq0ovS+nCcGX4+3qVbi3jYOmCTW48hg9SBBLtInx9+o7fFt4H5iP0Q==" }, "node_modules/@types/aws-lambda": { - "version": "8.10.138", - "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.138.tgz", - "integrity": "sha512-71EHMl70TPWIAsFuHd85NHq6S6T2OOjiisPTrH7RgcjzpJpPh4RQJv7PvVvIxc6PIp8CLV7F9B+TdjcAES5vcA==" + "version": "8.10.140", + "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.140.tgz", + "integrity": "sha512-4Dh3dk2TUcbdfHrX0Al90mNGJDvA9NBiTQPzbrjGi/dLxzKCGOYgT8YQ47jUKNFALkAJAadifq0pzyjIUlhVhg==" }, "node_modules/@types/btoa-lite": { "version": "1.0.2", @@ -440,9 +440,9 @@ } }, "node_modules/@types/node": { - "version": "20.12.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.13.tgz", - "integrity": "sha512-gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA==", + "version": "20.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", + "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", "dependencies": { "undici-types": "~5.26.4" } @@ -488,9 +488,9 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dependencies": { "ms": "2.1.2" }, @@ -600,9 +600,9 @@ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" }, "node_modules/lru-cache": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", - "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz", + "integrity": "sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==", "engines": { "node": "14 || >=16.14" } @@ -671,13 +671,13 @@ } }, "node_modules/simple-git": { - "version": "3.24.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.24.0.tgz", - "integrity": "sha512-QqAKee9Twv+3k8IFOFfPB2hnk6as6Y6ACUpwCtQvRYBAes23Wv3SZlHVobAzqcE8gfsisCvPw3HGW3HYM+VYYw==", + "version": "3.25.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.25.0.tgz", + "integrity": "sha512-KIY5sBnzc4yEcJXW7Tdv4viEz8KyG+nU0hay+DWZasvdFOYKeUZ6Xc25LUHHjw0tinPT7O1eY6pzX7pRT1K8rw==", "dependencies": { "@kwsites/file-exists": "^1.1.1", "@kwsites/promise-deferred": "^1.1.1", - "debug": "^4.3.4" + "debug": "^4.3.5" }, "funding": { "type": "github", diff --git a/package.json b/package.json index 3bcfb5d..d5e11b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mattpolzin/harmony", - "version": "4.2.0", + "version": "4.3.0", "engines": { "node": ">=18.0.0" }, diff --git a/src/AppVersion.idr b/src/AppVersion.idr index f8d0a5e..9667775 100644 --- a/src/AppVersion.idr +++ b/src/AppVersion.idr @@ -4,7 +4,7 @@ module AppVersion export appVersion : String -appVersion = "4.2.0" +appVersion = "4.3.0" export printVersion : HasIO io => io ()