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

Fossa-deps file support bower type (for custom integration for users moving from 1.x) #406

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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