- Fold most of getPackageVersions into preparePackageVersion
We pass to preparePackageVersion the metadata file we are dealing with
so it can be mentioned in case of errors.
- Replace `fail` by `error`. Shake uses exceptions to signal build
failures. It turns out `error` gets displayed slightly better when
caught by shake. Also we can use it in pure code.
The function preparePackageVersion is now responsible for doing
everything we need to do to be able to include the package in the index.
The function also returns a denormalised view of the package information
which can be taken as a proof that everything is consistent.
Lazy IO tends to keep file handles open until the entire file is read,
which in this case may never happen. This leads to the process exceeding
the system's file descriptor limit, resulting in #35.
Implement a new flag "--write-metadata" which will create, in the output
directory, a file "foliage/packages.json" with metadata about the
package provenance.
The file package.json file looks like this
```
{
"Win32-network-0.1.0.0": {
"source": {
"url": "github:input-output-hk/Win32-network/3825d3abf75f83f406c1f7161883c438dac7277d"
},
"timestamp": "2022-10-17T00:00:00Z"
},
"Win32-network-0.1.1.0": {
...
```
The idea is that tools fetching the repo can also fetch this file to
obtain information about the package provenance.
- Summary page has the list of all packages available (with details of the latest version)
- Timeline page has the list of all entries as they appear in the index
Also:
- Rebuild sdists is they are missing