bdcs-api-0.1.3: BDCS API Server

Safe HaskellNone
LanguageHaskell2010

BDCS.API.Recipe

Description

Recipe is used to store information about what packages are included in a composition.

It can be converted to and from TOML and JSON when needed.

Synopsis

Documentation

bumpVersion :: Maybe String -> Maybe String -> Either String String Source #

semver recipe version number bump

prev_ver
Previous version
new_ver
New version
  • If neither have a version 0.0.1 is returned
  • If there is no previous version the new version is checked and returned
  • If there is no new version, but there is a previous one, bump its patch level
  • If the previous and new versions are the same, bump the patch level
  • If they are different, check and return the new version

Errors will be returned in the Left

getAllRecipeProjects :: Recipe -> [String] Source #

Return a sorted list of the unique module+packages in a recipe

parseRecipe :: Text -> Either String Recipe Source #

Parse a TOML formatted recipe string and return a Recipe

If there is an error the details will be returned in the Left

recipeTOML :: Recipe -> Text Source #

Convert a Recipe to a TOML string

recipeTomlFilename :: String -> Text Source #

Convert a recipe name to a toml filename

name
The recipe name (not filename)

Replaces spaces with - and append .toml

recipeBumpVersion :: Recipe -> Maybe String -> Either String Recipe Source #

Bump or replace a Recipe Version with a new one

recipe
The Recipe to bump
prev_version
Previous version of the recipe

Pass the new recipe and the version from the previous recipe Returns a new recipe with the correct version

Errors will be returned in the Left

data Recipe Source #

Recipe data structure

Note that at this time there is no real distinction between package and modules.

Constructors

Recipe 

Fields