Web.Bower.PackageMeta

bower-json-1.1.0.0: Read bower.json from Haskell

Safe Haskell | None
Language | Haskell2010

Web.Bower.PackageMeta

Contents

- Data types
- Parsing

Description

A data type representing the Bower.json package description file, together with a parser and related functions.

This code is based on the specification at https://github.com/bower/bower.json-spec.

Synopsis

- data PackageMeta = PackageMeta {
  - bowerName :: PackageName
  - bowerDescription :: Maybe Text
  - bowerMain :: [FilePath]
  - bowerModuleType :: [ModuleType]
  - bowerLicense :: [Text]
  - bowerIgnore :: [Text]
  - bowerKeywords :: [Text]
  - bowerAuthors :: [Author]
  - bowerHomepage :: Maybe Text
  - bowerRepository :: Maybe Repository
  - bowerDependencies :: [(PackageName, VersionRange)]
  - bowerDevDependencies :: [(PackageName, VersionRange)]
  - bowerResolutions :: [(PackageName, Version)]
  - bowerPrivate :: Bool
  }
- data PackageName
- runPackageName :: PackageName -> Text
- mkPackageName :: Text -> Either PackageNameError PackageName
- data Author = Author {
  - authorName :: Text
  - authorEmail :: Maybe Text
  - authorHomepage :: Maybe Text
  }
- data ModuleType
  - = Globals
  - | AMD
  - | Node
  - | ES6
  - | YUI
- moduleTypes :: [(Text, ModuleType)]
- data Repository = Repository {
  - repositoryUrl :: Text
  - repositoryType :: Text
  }
- newtype Version = Version {
  - runVersion :: Text
  }
- newtype VersionRange = VersionRange {
  - runVersionRange :: Text
  }
- data BowerError
  - = InvalidPackageName PackageNameError
  - | InvalidModuleType Text
- showBowerError :: BowerError -> Text
- data PackageNameError
  - = NotEmpty
  - | TooLong Int
  - | InvalidChars [Char]
  - | RepeatedSeparators
  - | MustNotBeginSeparator
  - | MustNotEndSeparator
- showPackageNameError :: PackageNameError -> Text
- decodeFile :: FilePath -> IO (Either (ParseError BowerError) PackageMeta)
- displayError :: ParseError BowerError -> Text
- asPackageMeta :: Parse BowerError PackageMeta
- parseModuleType :: Text -> Either BowerError ModuleType
- parsePackageName :: Text -> Either BowerError PackageName
- asAuthor :: Parse e Author
- asRepository :: Parse e Repository

# Data types

data PackageMeta #

A data type representing the data stored in a bower.json package manifest file.

Note that the `ToJSON` / `FromJSON` instances don't exactly match; for example, it is not always the case that decoding from JSON and then encoding to JSON will give you the exact same JSON that you started with. However, if you start with a PackageMeta value, encode to JSON, and then decode, you should always get the same value back.

Constructors

PackageMeta |
Fields bowerName :: PackageName bowerDescription :: Maybe Text bowerMain :: [FilePath] bowerModuleType :: [ModuleType] bowerLicense :: [Text] bowerIgnore :: [Text] bowerKeywords :: [Text] bowerAuthors :: [Author] bowerHomepage :: Maybe Text bowerRepository :: Maybe Repository bowerDependencies :: [(PackageName, VersionRange)] bowerDevDependencies :: [(PackageName, VersionRange)] bowerResolutions :: [(PackageName, Version)] bowerPrivate :: Bool

#### Instances

Instances details

FromJSON PackageMeta # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods parseJSON :: Value -> Parser PackageMeta # parseJSONList :: Value -> Parser [PackageMeta] # omittedField :: Maybe PackageMeta #
ToJSON PackageMeta # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods toJSON :: PackageMeta -> Value # toEncoding :: PackageMeta -> Encoding # toJSONList :: [PackageMeta] -> Value # toEncodingList :: [PackageMeta] -> Encoding # omitField :: PackageMeta -> Bool #
NFData PackageMeta # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods rnf :: PackageMeta -> () #
Generic PackageMeta # |
Instance details Defined in Web.Bower.PackageMeta.Internal Associated Types
type Rep PackageMeta |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep PackageMeta = D1 ('MetaData "PackageMeta" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) (C1 ('MetaCons "PackageMeta" 'PrefixI 'True) (((S1 ('MetaSel ('Just "bowerName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: (S1 ('MetaSel ('Just "bowerDescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "bowerMain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath]))) :*: ((S1 ('MetaSel ('Just "bowerModuleType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ModuleType]) :*: S1 ('MetaSel ('Just "bowerLicense") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])) :*: (S1 ('MetaSel ('Just "bowerIgnore") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text]) :*: S1 ('MetaSel ('Just "bowerKeywords") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])))) :*: ((S1 ('MetaSel ('Just "bowerAuthors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Author]) :*: (S1 ('MetaSel ('Just "bowerHomepage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "bowerRepository") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Repository)))) :*: ((S1 ('MetaSel ('Just "bowerDependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(PackageName, VersionRange)]) :*: S1 ('MetaSel ('Just "bowerDevDependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(PackageName, VersionRange)])) :*: (S1 ('MetaSel ('Just "bowerResolutions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(PackageName, Version)]) :*: S1 ('MetaSel ('Just "bowerPrivate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))))
Methods from :: PackageMeta -> Rep PackageMeta x # to :: Rep PackageMeta x -> PackageMeta #
Show PackageMeta # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods showsPrec :: Int -> PackageMeta -> ShowS # show :: PackageMeta -> String # showList :: [PackageMeta] -> ShowS #
Eq PackageMeta # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods (==) :: PackageMeta -> PackageMeta -> Bool # (/=) :: PackageMeta -> PackageMeta -> Bool #
Ord PackageMeta # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods compare :: PackageMeta -> PackageMeta -> Ordering # (<) :: PackageMeta -> PackageMeta -> Bool # (<=) :: PackageMeta -> PackageMeta -> Bool # (>) :: PackageMeta -> PackageMeta -> Bool # (>=) :: PackageMeta -> PackageMeta -> Bool # max :: PackageMeta -> PackageMeta -> PackageMeta # min :: PackageMeta -> PackageMeta -> PackageMeta #
type Rep PackageMeta # |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep PackageMeta = D1 ('MetaData "PackageMeta" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) (C1 ('MetaCons "PackageMeta" 'PrefixI 'True) (((S1 ('MetaSel ('Just "bowerName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: (S1 ('MetaSel ('Just "bowerDescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "bowerMain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath]))) :*: ((S1 ('MetaSel ('Just "bowerModuleType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ModuleType]) :*: S1 ('MetaSel ('Just "bowerLicense") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])) :*: (S1 ('MetaSel ('Just "bowerIgnore") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text]) :*: S1 ('MetaSel ('Just "bowerKeywords") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])))) :*: ((S1 ('MetaSel ('Just "bowerAuthors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Author]) :*: (S1 ('MetaSel ('Just "bowerHomepage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "bowerRepository") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Repository)))) :*: ((S1 ('MetaSel ('Just "bowerDependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(PackageName, VersionRange)]) :*: S1 ('MetaSel ('Just "bowerDevDependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(PackageName, VersionRange)])) :*: (S1 ('MetaSel ('Just "bowerResolutions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(PackageName, Version)]) :*: S1 ('MetaSel ('Just "bowerPrivate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))))

data PackageName #

A valid package name for a Bower package.

#### Instances

Instances details

FromJSON PackageName # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods parseJSON :: Value -> Parser PackageName # parseJSONList :: Value -> Parser [PackageName] # omittedField :: Maybe PackageName #
ToJSON PackageName # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods toJSON :: PackageName -> Value # toEncoding :: PackageName -> Encoding # toJSONList :: [PackageName] -> Value # toEncodingList :: [PackageName] -> Encoding # omitField :: PackageName -> Bool #
NFData PackageName # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods rnf :: PackageName -> () #
Generic PackageName # |
Instance details Defined in Web.Bower.PackageMeta.Internal Associated Types
type Rep PackageName |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep PackageName = D1 ('MetaData "PackageName" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'True) (C1 ('MetaCons "PackageName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Methods from :: PackageName -> Rep PackageName x # to :: Rep PackageName x -> PackageName #
Show PackageName # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods showsPrec :: Int -> PackageName -> ShowS # show :: PackageName -> String # showList :: [PackageName] -> ShowS #
Eq PackageName # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods (==) :: PackageName -> PackageName -> Bool # (/=) :: PackageName -> PackageName -> Bool #
Ord PackageName # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods compare :: PackageName -> PackageName -> Ordering # (<) :: PackageName -> PackageName -> Bool # (<=) :: PackageName -> PackageName -> Bool # (>) :: PackageName -> PackageName -> Bool # (>=) :: PackageName -> PackageName -> Bool # max :: PackageName -> PackageName -> PackageName # min :: PackageName -> PackageName -> PackageName #
type Rep PackageName # |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep PackageName = D1 ('MetaData "PackageName" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'True) (C1 ('MetaCons "PackageName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

runPackageName :: PackageName -> Text #

mkPackageName :: Text -> Either PackageNameError PackageName #

A smart constructor for a PackageName. It ensures that the package name satisfies the restrictions described at https://github.com/bower/bower.json-spec#name.

data Author #

Constructors

Author |
Fields authorName :: Text authorEmail :: Maybe Text authorHomepage :: Maybe Text

#### Instances

Instances details

FromJSON Author # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods parseJSON :: Value -> Parser Author # parseJSONList :: Value -> Parser [Author] # omittedField :: Maybe Author #
ToJSON Author # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods toJSON :: Author -> Value # toEncoding :: Author -> Encoding # toJSONList :: [Author] -> Value # toEncodingList :: [Author] -> Encoding # omitField :: Author -> Bool #
NFData Author # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods rnf :: Author -> () #
Generic Author # |
Instance details Defined in Web.Bower.PackageMeta.Internal Associated Types
type Rep Author |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep Author = D1 ('MetaData "Author" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) (C1 ('MetaCons "Author" 'PrefixI 'True) (S1 ('MetaSel ('Just "authorName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "authorEmail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "authorHomepage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))))
Methods from :: Author -> Rep Author x # to :: Rep Author x -> Author #
Show Author # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods showsPrec :: Int -> Author -> ShowS # show :: Author -> String # showList :: [Author] -> ShowS #
Eq Author # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods (==) :: Author -> Author -> Bool # (/=) :: Author -> Author -> Bool #
Ord Author # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods compare :: Author -> Author -> Ordering # (<) :: Author -> Author -> Bool # (<=) :: Author -> Author -> Bool # (>) :: Author -> Author -> Bool # (>=) :: Author -> Author -> Bool # max :: Author -> Author -> Author # min :: Author -> Author -> Author #
type Rep Author # |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep Author = D1 ('MetaData "Author" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) (C1 ('MetaCons "Author" 'PrefixI 'True) (S1 ('MetaSel ('Just "authorName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "authorEmail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "authorHomepage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))))

data ModuleType #

See: https://github.com/bower/bower.json-spec#moduletype

Constructors

Globals |
AMD |
Node |
ES6 |
YUI |

#### Instances

Instances details

FromJSON ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods parseJSON :: Value -> Parser ModuleType # parseJSONList :: Value -> Parser [ModuleType] # omittedField :: Maybe ModuleType #
ToJSON ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods toJSON :: ModuleType -> Value # toEncoding :: ModuleType -> Encoding # toJSONList :: [ModuleType] -> Value # toEncodingList :: [ModuleType] -> Encoding # omitField :: ModuleType -> Bool #
NFData ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods rnf :: ModuleType -> () #
Bounded ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods minBound :: ModuleType # maxBound :: ModuleType #
Enum ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods succ :: ModuleType -> ModuleType # pred :: ModuleType -> ModuleType # toEnum :: Int -> ModuleType # fromEnum :: ModuleType -> Int # enumFrom :: ModuleType -> [ModuleType] # enumFromThen :: ModuleType -> ModuleType -> [ModuleType] # enumFromTo :: ModuleType -> ModuleType -> [ModuleType] # enumFromThenTo :: ModuleType -> ModuleType -> ModuleType -> [ModuleType] #
Generic ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal Associated Types
type Rep ModuleType |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep ModuleType = D1 ('MetaData "ModuleType" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) ((C1 ('MetaCons "Globals" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AMD" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Node" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ES6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "YUI" 'PrefixI 'False) (U1 :: Type -> Type))))
Methods from :: ModuleType -> Rep ModuleType x # to :: Rep ModuleType x -> ModuleType #
Show ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods showsPrec :: Int -> ModuleType -> ShowS # show :: ModuleType -> String # showList :: [ModuleType] -> ShowS #
Eq ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods (==) :: ModuleType -> ModuleType -> Bool # (/=) :: ModuleType -> ModuleType -> Bool #
Ord ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods compare :: ModuleType -> ModuleType -> Ordering # (<) :: ModuleType -> ModuleType -> Bool # (<=) :: ModuleType -> ModuleType -> Bool # (>) :: ModuleType -> ModuleType -> Bool # (>=) :: ModuleType -> ModuleType -> Bool # max :: ModuleType -> ModuleType -> ModuleType # min :: ModuleType -> ModuleType -> ModuleType #
type Rep ModuleType # |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep ModuleType = D1 ('MetaData "ModuleType" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) ((C1 ('MetaCons "Globals" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AMD" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Node" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ES6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "YUI" 'PrefixI 'False) (U1 :: Type -> Type))))

moduleTypes :: [(Text, ModuleType)] #

data Repository #

Constructors

Repository |
Fields repositoryUrl :: Text repositoryType :: Text

#### Instances

Instances details

FromJSON Repository # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods parseJSON :: Value -> Parser Repository # parseJSONList :: Value -> Parser [Repository] # omittedField :: Maybe Repository #
ToJSON Repository # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods toJSON :: Repository -> Value # toEncoding :: Repository -> Encoding # toJSONList :: [Repository] -> Value # toEncodingList :: [Repository] -> Encoding # omitField :: Repository -> Bool #
NFData Repository # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods rnf :: Repository -> () #
Generic Repository # |
Instance details Defined in Web.Bower.PackageMeta.Internal Associated Types
type Rep Repository |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep Repository = D1 ('MetaData "Repository" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) (C1 ('MetaCons "Repository" 'PrefixI 'True) (S1 ('MetaSel ('Just "repositoryUrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "repositoryType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Methods from :: Repository -> Rep Repository x # to :: Rep Repository x -> Repository #
Show Repository # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods showsPrec :: Int -> Repository -> ShowS # show :: Repository -> String # showList :: [Repository] -> ShowS #
Eq Repository # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods (==) :: Repository -> Repository -> Bool # (/=) :: Repository -> Repository -> Bool #
Ord Repository # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods compare :: Repository -> Repository -> Ordering # (<) :: Repository -> Repository -> Bool # (<=) :: Repository -> Repository -> Bool # (>) :: Repository -> Repository -> Bool # (>=) :: Repository -> Repository -> Bool # max :: Repository -> Repository -> Repository # min :: Repository -> Repository -> Repository #
type Rep Repository # |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep Repository = D1 ('MetaData "Repository" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) (C1 ('MetaCons "Repository" 'PrefixI 'True) (S1 ('MetaSel ('Just "repositoryUrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "repositoryType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype Version #

Constructors

Version |
Fields runVersion :: Text

#### Instances

Instances details

FromJSON Version # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods parseJSON :: Value -> Parser Version # parseJSONList :: Value -> Parser [Version] # omittedField :: Maybe Version #
ToJSON Version # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods toJSON :: Version -> Value # toEncoding :: Version -> Encoding # toJSONList :: [Version] -> Value # toEncodingList :: [Version] -> Encoding # omitField :: Version -> Bool #
NFData Version # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods rnf :: Version -> () #
Generic Version # |
Instance details Defined in Web.Bower.PackageMeta.Internal Associated Types
type Rep Version |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep Version = D1 ('MetaData "Version" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'True) (C1 ('MetaCons "Version" 'PrefixI 'True) (S1 ('MetaSel ('Just "runVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Methods from :: Version -> Rep Version x # to :: Rep Version x -> Version #
Show Version # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods showsPrec :: Int -> Version -> ShowS # show :: Version -> String # showList :: [Version] -> ShowS #
Eq Version # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods (==) :: Version -> Version -> Bool # (/=) :: Version -> Version -> Bool #
Ord Version # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods compare :: Version -> Version -> Ordering # (<) :: Version -> Version -> Bool # (<=) :: Version -> Version -> Bool # (>) :: Version -> Version -> Bool # (>=) :: Version -> Version -> Bool # max :: Version -> Version -> Version # min :: Version -> Version -> Version #
type Rep Version # |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep Version = D1 ('MetaData "Version" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'True) (C1 ('MetaCons "Version" 'PrefixI 'True) (S1 ('MetaSel ('Just "runVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype VersionRange #

Constructors

VersionRange |
Fields runVersionRange :: Text

#### Instances

Instances details

FromJSON VersionRange # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods parseJSON :: Value -> Parser VersionRange # parseJSONList :: Value -> Parser [VersionRange] # omittedField :: Maybe VersionRange #
ToJSON VersionRange # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods toJSON :: VersionRange -> Value # toEncoding :: VersionRange -> Encoding # toJSONList :: [VersionRange] -> Value # toEncodingList :: [VersionRange] -> Encoding # omitField :: VersionRange -> Bool #
NFData VersionRange # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods rnf :: VersionRange -> () #
Generic VersionRange # |
Instance details Defined in Web.Bower.PackageMeta.Internal Associated Types
type Rep VersionRange |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep VersionRange = D1 ('MetaData "VersionRange" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'True) (C1 ('MetaCons "VersionRange" 'PrefixI 'True) (S1 ('MetaSel ('Just "runVersionRange") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Methods from :: VersionRange -> Rep VersionRange x # to :: Rep VersionRange x -> VersionRange #
Show VersionRange # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods showsPrec :: Int -> VersionRange -> ShowS # show :: VersionRange -> String # showList :: [VersionRange] -> ShowS #
Eq VersionRange # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods (==) :: VersionRange -> VersionRange -> Bool # (/=) :: VersionRange -> VersionRange -> Bool #
Ord VersionRange # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods compare :: VersionRange -> VersionRange -> Ordering # (<) :: VersionRange -> VersionRange -> Bool # (<=) :: VersionRange -> VersionRange -> Bool # (>) :: VersionRange -> VersionRange -> Bool # (>=) :: VersionRange -> VersionRange -> Bool # max :: VersionRange -> VersionRange -> VersionRange # min :: VersionRange -> VersionRange -> VersionRange #
type Rep VersionRange # |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep VersionRange = D1 ('MetaData "VersionRange" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'True) (C1 ('MetaCons "VersionRange" 'PrefixI 'True) (S1 ('MetaSel ('Just "runVersionRange") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data BowerError #

Constructors

InvalidPackageName PackageNameError |
InvalidModuleType Text |

#### Instances

Instances details

NFData BowerError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods rnf :: BowerError -> () #
Generic BowerError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Associated Types
type Rep BowerError |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep BowerError = D1 ('MetaData "BowerError" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) (C1 ('MetaCons "InvalidPackageName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageNameError)) :+: C1 ('MetaCons "InvalidModuleType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Methods from :: BowerError -> Rep BowerError x # to :: Rep BowerError x -> BowerError #
Show BowerError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods showsPrec :: Int -> BowerError -> ShowS # show :: BowerError -> String # showList :: [BowerError] -> ShowS #
Eq BowerError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods (==) :: BowerError -> BowerError -> Bool # (/=) :: BowerError -> BowerError -> Bool #
Ord BowerError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods compare :: BowerError -> BowerError -> Ordering # (<) :: BowerError -> BowerError -> Bool # (<=) :: BowerError -> BowerError -> Bool # (>) :: BowerError -> BowerError -> Bool # (>=) :: BowerError -> BowerError -> Bool # max :: BowerError -> BowerError -> BowerError # min :: BowerError -> BowerError -> BowerError #
type Rep BowerError # |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep BowerError = D1 ('MetaData "BowerError" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) (C1 ('MetaCons "InvalidPackageName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageNameError)) :+: C1 ('MetaCons "InvalidModuleType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

showBowerError :: BowerError -> Text #

data PackageNameError #

Constructors

NotEmpty |
TooLong Int |
InvalidChars [Char] |
RepeatedSeparators |
MustNotBeginSeparator |
MustNotEndSeparator |

#### Instances

Instances details

NFData PackageNameError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods rnf :: PackageNameError -> () #
Generic PackageNameError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Associated Types
type Rep PackageNameError |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep PackageNameError = D1 ('MetaData "PackageNameError" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) ((C1 ('MetaCons "NotEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "TooLong" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "InvalidChars" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Char])))) :+: (C1 ('MetaCons "RepeatedSeparators" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MustNotBeginSeparator" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MustNotEndSeparator" 'PrefixI 'False) (U1 :: Type -> Type))))
Methods from :: PackageNameError -> Rep PackageNameError x # to :: Rep PackageNameError x -> PackageNameError #
Show PackageNameError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods showsPrec :: Int -> PackageNameError -> ShowS # show :: PackageNameError -> String # showList :: [PackageNameError] -> ShowS #
Eq PackageNameError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods (==) :: PackageNameError -> PackageNameError -> Bool # (/=) :: PackageNameError -> PackageNameError -> Bool #
Ord PackageNameError # |
Instance details Defined in Web.Bower.PackageMeta.Internal Methods compare :: PackageNameError -> PackageNameError -> Ordering # (<) :: PackageNameError -> PackageNameError -> Bool # (<=) :: PackageNameError -> PackageNameError -> Bool # (>) :: PackageNameError -> PackageNameError -> Bool # (>=) :: PackageNameError -> PackageNameError -> Bool # max :: PackageNameError -> PackageNameError -> PackageNameError # min :: PackageNameError -> PackageNameError -> PackageNameError #
type Rep PackageNameError # |
Instance details Defined in Web.Bower.PackageMeta.Internal type Rep PackageNameError = D1 ('MetaData "PackageNameError" "Web.Bower.PackageMeta.Internal" "bower-json-1.1.0.0-jO69mgpFENCyhfpTWBBfX" 'False) ((C1 ('MetaCons "NotEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "TooLong" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "InvalidChars" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Char])))) :+: (C1 ('MetaCons "RepeatedSeparators" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MustNotBeginSeparator" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MustNotEndSeparator" 'PrefixI 'False) (U1 :: Type -> Type))))

showPackageNameError :: PackageNameError -> Text #

# Parsing

decodeFile :: FilePath -> IO (Either (ParseError BowerError) PackageMeta) #

Read and attempt to decode a bower.json file.

displayError :: ParseError BowerError -> Text #

asPackageMeta :: Parse BowerError PackageMeta #

A parser for bower.json files, using the aeson-better-errors package.

parseModuleType :: Text -> Either BowerError ModuleType #

parsePackageName :: Text -> Either BowerError PackageName #

asAuthor :: Parse e Author #

asRepository :: Parse e Repository #