1
1
mirror of https://github.com/github/semantic.git synced 2024-12-03 00:16:52 +03:00

🔥 Package versions.

We don’t have any way to populate this currently.
This commit is contained in:
Rob Rix 2018-06-22 08:51:09 -04:00
parent eedc8f4b7e
commit 4ec77ee860
2 changed files with 3 additions and 7 deletions

View File

@ -12,14 +12,10 @@ type PackageName = Name
-- | Metadata for a package (name and version).
data PackageInfo = PackageInfo
{ packageName :: PackageName
, packageVersion :: Maybe Version
, packageResolutions :: Map.Map FilePath FilePath
}
deriving (Eq, Ord, Show)
newtype Version = Version { versionString :: String }
deriving (Eq, Ord, Show)
newtype PackageBody term = PackageBody
{ packageModules :: ModuleTable (NonEmpty (Module term))
}
@ -33,5 +29,5 @@ data Package term = Package
}
deriving (Eq, Functor, Ord, Show)
fromModules :: PackageName -> Maybe Version -> [Module term] -> Map.Map FilePath FilePath -> Package term
fromModules name version modules resolutions = Package (PackageInfo name version resolutions) (PackageBody (ModuleTable.fromModules modules))
fromModules :: PackageName -> [Module term] -> Map.Map FilePath FilePath -> Package term
fromModules name modules resolutions = Package (PackageInfo name resolutions) (PackageBody (ModuleTable.fromModules modules))

View File

@ -175,7 +175,7 @@ parsePackage :: (Member (Distribute WrappedTask) effs, Member Resolution effs, M
parsePackage parser project@Project{..} = do
p <- parseModules parser project
resMap <- Task.resolutionMap project
let pkg = Package.fromModules n Nothing p resMap
let pkg = Package.fromModules n p resMap
pkg <$ trace ("project: " <> show pkg)
where