tricorder-types 0.4.1.0 → 0.4.2.0
raw patch · 5 files changed
+49/−16 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Tricorder.CLI.Command: JsonOutput :: OutputFormat
- Tricorder.CLI.Command: TextOutput :: OutputFormat
- Tricorder.CLI.Command: data OutputFormat
- Tricorder.CLI.Command: instance GHC.Classes.Eq Tricorder.CLI.Command.OutputFormat
+ Tricorder.CLI.Command: Daemon :: DaemonCommand -> Command
+ Tricorder.CLI.Command.Daemon: Info :: OutputFormat -> DaemonCommand
+ Tricorder.CLI.Command.Daemon: data DaemonCommand
+ Tricorder.CLI.Command.Daemon: toArgs :: DaemonCommand -> [String]
+ Tricorder.CLI.Command.OutputFormat: JsonOutput :: OutputFormat
+ Tricorder.CLI.Command.OutputFormat: TextOutput :: OutputFormat
+ Tricorder.CLI.Command.OutputFormat: data OutputFormat
+ Tricorder.CLI.Command.OutputFormat: instance GHC.Classes.Eq Tricorder.CLI.Command.OutputFormat.OutputFormat
+ Tricorder.CLI.Command.OutputFormat: toArgs :: OutputFormat -> [String]
Files
- CHANGELOG.md +6/−0
- src/Tricorder/CLI/Command.hs +9/−14
- src/Tricorder/CLI/Command/Daemon.hs +14/−0
- src/Tricorder/CLI/Command/OutputFormat.hs +16/−0
- tricorder-types.cabal +4/−2
CHANGELOG.md view
@@ -7,6 +7,12 @@ ## [Unreleased] +## [0.4.2.0] - 2026-10-02++### Added++- `Daemon.Info` command.+ ## [0.4.1.0] - 2026-09-17 ### Added
src/Tricorder/CLI/Command.hs view
@@ -3,7 +3,6 @@ , EvalCommentsOptions (..) , Force (..) , LogMode (..)- , OutputFormat (..) , StatusOptions (..) , TestOptions (..) , Verbosity (..)@@ -12,9 +11,14 @@ ) where +import Tricorder.CLI.Command.Daemon (DaemonCommand)+import Tricorder.CLI.Command.OutputFormat (OutputFormat (..)) import Tricorder.SourceLookup.SourceQuery (SourceQuery, renderSourceQuery) +import Tricorder.CLI.Command.Daemon qualified as Daemon+import Tricorder.CLI.Command.OutputFormat qualified as OutputFormat + data Force = Force | NoForce @@ -24,12 +28,6 @@ deriving stock (Eq) -data OutputFormat- = TextOutput- | JsonOutput- deriving stock (Eq)-- data Verbosity = Concise | Verbose@@ -69,6 +67,7 @@ | Source [SourceQuery] | Restart Force | EvalComments EvalCommentsOptions+ | Daemon DaemonCommand -- | Render a 'Command' to the argument list the @tricorder@ CLI expects@@ -83,7 +82,7 @@ commandToArgs (Status (StatusOptions {wait, format, verbosity, expand})) = "status" : waitArgs wait- <> formatArgs format+ <> OutputFormat.toArgs format <> verbosityArgs verbosity <> maybe [] (\n -> ["--expand", show n]) expand commandToArgs (Test (TestOptions {failedOnly, wait})) =@@ -94,7 +93,8 @@ commandToArgs (Source queries) = "source" : map renderSourceQuery queries commandToArgs (Restart doForce) = "restart" : forceArgs doForce commandToArgs (EvalComments (EvalCommentsOptions {wait, format})) =- "eval-comments" : waitArgs wait <> formatArgs format+ "eval-comments" : waitArgs wait <> OutputFormat.toArgs format+commandToArgs (Daemon daemonCommand) = "daemon" : Daemon.toArgs daemonCommand forceArgs :: Force -> [String]@@ -105,11 +105,6 @@ waitArgs :: WaitMode -> [String] waitArgs WaitForBuild = ["--wait"] waitArgs ShowCurrent = []---formatArgs :: OutputFormat -> [String]-formatArgs JsonOutput = ["--json"]-formatArgs TextOutput = [] verbosityArgs :: Verbosity -> [String]
+ src/Tricorder/CLI/Command/Daemon.hs view
@@ -0,0 +1,14 @@+module Tricorder.CLI.Command.Daemon (DaemonCommand (..), toArgs) where++import Tricorder.CLI.Command.OutputFormat (OutputFormat)++import Tricorder.CLI.Command.OutputFormat qualified as OutputFormat+++data DaemonCommand+ = Info OutputFormat+++toArgs :: DaemonCommand -> [String]+toArgs = \case+ Info format -> "info" : OutputFormat.toArgs format
+ src/Tricorder/CLI/Command/OutputFormat.hs view
@@ -0,0 +1,16 @@+module Tricorder.CLI.Command.OutputFormat+ ( OutputFormat (..)+ , toArgs+ )+where+++data OutputFormat+ = TextOutput+ | JsonOutput+ deriving stock (Eq)+++toArgs :: OutputFormat -> [String]+toArgs JsonOutput = ["--json"]+toArgs TextOutput = []
tricorder-types.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: tricorder-types-version: 0.4.1.0+version: 0.4.2.0 synopsis: Shared domain types for various Tricorder components description: Shared domain types for various Tricorder components like [Tricorder itself](https://hackage.haskell.org/package/tricorder) and@@ -13,7 +13,7 @@ category: Development homepage: https://github.com/tweag/tricorder#readme bug-reports: https://github.com/tweag/tricorder/issues-author: Victor Nascimento Bakke+author: Christian Georgii maintainer: victor.bakke@tweag.io license: MIT license-file: LICENSE@@ -35,6 +35,8 @@ library exposed-modules: Tricorder.CLI.Command+ Tricorder.CLI.Command.Daemon+ Tricorder.CLI.Command.OutputFormat Tricorder.SourceLookup.SourceQuery other-modules: Paths_tricorder_types