servant-serf 0.3.0.1 → 0.3.1.0
raw patch · 4 files changed
+13/−3 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ ServantSerf.Type.Config: [excludeSuffix] :: Config -> String
+ ServantSerf.Type.Flag: ExcludeSuffix :: String -> Flag
- ServantSerf.Type.Config: Config :: String -> Depth -> Bool -> Maybe ModuleName -> String -> Bool -> Config
+ ServantSerf.Type.Config: Config :: String -> Depth -> String -> Bool -> Maybe ModuleName -> String -> Bool -> Config
Files
- servant-serf.cabal +2/−2
- source/library/ServantSerf/Module.hs +2/−1
- source/library/ServantSerf/Type/Config.hs +3/−0
- source/library/ServantSerf/Type/Flag.hs +6/−0
servant-serf.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.0 name: servant-serf-version: 0.3.0.1+version: 0.3.1.0 synopsis: Automatically generate Servant API modules. description: = servant-serf@@ -50,7 +50,7 @@ @API@. Note that the same name is used for both referenced API types and the generated API type. .- - @server-name=STRING@: Sets the name to use for the server value. Defaults+ - @--server-name=STRING@: Sets the name to use for the server value. Defaults to @server@. Note that the same name is used for both referenced server values and the generated server value. .
source/library/ServantSerf/Module.hs view
@@ -21,7 +21,8 @@ $ Context.source context Just x -> ModuleName.toString x moduleNames =- fmap ModuleName.toString+ filter (not . List.isSuffixOf (Config.excludeSuffix config))+ . fmap ModuleName.toString . List.sort . Maybe.mapMaybe ModuleName.fromFilePath $ filter (FilePath.isExtensionOf "hs") files
source/library/ServantSerf/Type/Config.hs view
@@ -11,6 +11,7 @@ data Config = Config { apiName :: String , depth :: Depth.Depth+ , excludeSuffix :: String , help :: Bool , moduleName :: Maybe ModuleName.ModuleName , serverName :: String@@ -27,6 +28,7 @@ Flag.Depth x -> case Depth.fromString x of Nothing -> Exception.throwM $ InvalidDepth.InvalidDepth x Just y -> pure config { depth = y }+ Flag.ExcludeSuffix x -> pure config { excludeSuffix = x } Flag.Help -> pure config { help = True } Flag.ModuleName x -> case ModuleName.fromString x of Nothing -> Exception.throwM $ InvalidModuleName.InvalidModuleName x@@ -38,6 +40,7 @@ initial = Config { apiName = "API" , depth = Depth.Deep+ , excludeSuffix = "" , help = False , moduleName = Nothing , serverName = "server"
source/library/ServantSerf/Type/Flag.hs view
@@ -5,6 +5,7 @@ data Flag = ApiName String | Depth String+ | ExcludeSuffix String | Help | ModuleName String | ServerName String@@ -33,6 +34,11 @@ ["depth"] (Console.ReqArg Depth "DEPTH") "Controls whether to search through only one directory (`shallow`) or recursively (`deep`). Defaults to `deep`."+ , Console.Option+ []+ ["exclude-suffix"]+ (Console.ReqArg ExcludeSuffix "SUFFIX")+ "Sets the module suffix to exclude. Defaults to the empty string." , Console.Option [] ["module-name"]