-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Read bower.json from Haskell
--   
--   Bower is a package manager for the web (see <a>http://bower.io</a>).
--   This package provides a data type and ToJSON/FromJSON instances for
--   Bower's package manifest file, bower.json.
@package bower-json
@version 1.0.0.1


-- | 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
--   <a>https://github.com/bower/bower.json-spec</a>.
module Web.Bower.PackageMeta

-- | A data type representing the data stored in a bower.json package
--   manifest file.
--   
--   Note that the <tt>ToJSON</tt> / <tt>FromJSON</tt> 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.
data PackageMeta
PackageMeta :: PackageName -> Maybe Text -> [FilePath] -> [ModuleType] -> [Text] -> [Text] -> [Text] -> [Author] -> Maybe Text -> Maybe Repository -> [(PackageName, VersionRange)] -> [(PackageName, VersionRange)] -> [(PackageName, Version)] -> Bool -> PackageMeta
[bowerName] :: PackageMeta -> PackageName
[bowerDescription] :: PackageMeta -> Maybe Text
[bowerMain] :: PackageMeta -> [FilePath]
[bowerModuleType] :: PackageMeta -> [ModuleType]
[bowerLicense] :: PackageMeta -> [Text]
[bowerIgnore] :: PackageMeta -> [Text]
[bowerKeywords] :: PackageMeta -> [Text]
[bowerAuthors] :: PackageMeta -> [Author]
[bowerHomepage] :: PackageMeta -> Maybe Text
[bowerRepository] :: PackageMeta -> Maybe Repository
[bowerDependencies] :: PackageMeta -> [(PackageName, VersionRange)]
[bowerDevDependencies] :: PackageMeta -> [(PackageName, VersionRange)]
[bowerResolutions] :: PackageMeta -> [(PackageName, Version)]
[bowerPrivate] :: PackageMeta -> Bool

-- | A valid package name for a Bower package.
data PackageName
runPackageName :: PackageName -> Text

-- | A smart constructor for a PackageName. It ensures that the package
--   name satisfies the restrictions described at
--   <a>https://github.com/bower/bower.json-spec#name</a>.
mkPackageName :: Text -> Either PackageNameError PackageName
data Author
Author :: Text -> Maybe Text -> Maybe Text -> Author
[authorName] :: Author -> Text
[authorEmail] :: Author -> Maybe Text
[authorHomepage] :: Author -> Maybe Text

-- | See: <a>https://github.com/bower/bower.json-spec#moduletype</a>
data ModuleType
Globals :: ModuleType
AMD :: ModuleType
Node :: ModuleType
ES6 :: ModuleType
YUI :: ModuleType
moduleTypes :: [(Text, ModuleType)]
data Repository
Repository :: Text -> Text -> Repository
[repositoryUrl] :: Repository -> Text
[repositoryType] :: Repository -> Text
newtype Version
Version :: Text -> Version
[runVersion] :: Version -> Text
newtype VersionRange
VersionRange :: Text -> VersionRange
[runVersionRange] :: VersionRange -> Text
data BowerError
InvalidPackageName :: PackageNameError -> BowerError
InvalidModuleType :: Text -> BowerError
showBowerError :: BowerError -> Text
data PackageNameError
NotEmpty :: PackageNameError
TooLong :: Int -> PackageNameError
InvalidChars :: [Char] -> PackageNameError
RepeatedSeparators :: PackageNameError
MustNotBeginSeparator :: PackageNameError
MustNotEndSeparator :: PackageNameError
showPackageNameError :: PackageNameError -> Text

-- | Read and attempt to decode a bower.json file.
decodeFile :: FilePath -> IO (Either (ParseError BowerError) PackageMeta)
displayError :: ParseError BowerError -> Text

-- | A parser for bower.json files, using the aeson-better-errors package.
asPackageMeta :: Parse BowerError PackageMeta
parseModuleType :: Text -> Either BowerError ModuleType
parsePackageName :: Text -> Either BowerError PackageName
asAuthor :: Parse e Author
asRepository :: Parse e Repository
