Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

Commit

Permalink
Adds bower support for fossa-deps (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
meghfossa authored Oct 26, 2021
1 parent 7e6dda9 commit 5cc42de
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/userguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ The `name` and `type` fields are required and specify the name of the dependency

Supported dependency types:

- `bower` - Bower dependencies that are typically found at found at [bower.io](https://registry.bower.io).
- `cargo` - Rust dependencies that are typically found at [crates.io](https://crates.io/).
- `carthage` - Dependencies as specified by the [Carthage](https://github.com/Carthage/Carthage) package manager.
- `composer` - Dependencies specified by the PHP package manager [Composer](https://getcomposer.org/), which are located on [Packagist](https://packagist.org/).
Expand Down
1 change: 1 addition & 0 deletions src/App/Fossa/ManualDeps.hs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ instance FromJSON DependencyMetadata where
-- Parse supported dependency types into their respective type or return Nothing.
depTypeFromText :: Text -> Maybe DepType
depTypeFromText text = case text of
"bower" -> Just BowerType
"cargo" -> Just CargoType
"carthage" -> Just CarthageType
"composer" -> Just ComposerType
Expand Down
2 changes: 2 additions & 0 deletions src/DepTypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ data DepEnvironment
data DepType
= -- | An archive upload dependency.
ArchiveType
| -- | Bower dependency
BowerType
| -- | A first-party subproject
SubprojectType
| -- | Dependency found from the composer fetcher.
Expand Down
2 changes: 2 additions & 0 deletions src/Srclib/Converter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ verConstraintToRevision = \case
depTypeToFetcher :: DepType -> Text
depTypeToFetcher = \case
ArchiveType -> "archive"
BowerType -> "bower"
CarthageType -> "cart"
CargoType -> "cargo"
ComposerType -> "comp"
Expand Down Expand Up @@ -126,6 +127,7 @@ depTypeToFetcher = \case
-- | GooglesourceType and SubprojectType are not supported with this function, since they're ambiguous.
fetcherToDepType :: Text -> Maybe DepType
fetcherToDepType fetcher | depTypeToFetcher ArchiveType == fetcher = Just ArchiveType
fetcherToDepType fetcher | depTypeToFetcher BowerType == fetcher = Just BowerType
fetcherToDepType fetcher | depTypeToFetcher CarthageType == fetcher = Just CarthageType
fetcherToDepType fetcher | depTypeToFetcher CargoType == fetcher = Just CargoType
fetcherToDepType fetcher | depTypeToFetcher ComposerType == fetcher = Just ComposerType
Expand Down

0 comments on commit 5cc42de

Please sign in to comment.