Skip to content

Fall back to spago.dhall files for packages without a bower.json #218

Closed

Description

@thomashoneyman

Some packages are in the PureScript registry and do not have bower.json files, but do have spago.dhall files sufficient for producing a valid Manifest. One example is halogen-hooks:

https://github.com/thomashoneyman/purescript-halogen-hooks/tree/v0.5.0

This repository doesn't have a bower.json file, but it does have a spago.dhall file that is sufficient for producing a manifest:

https://github.com/thomashoneyman/purescript-halogen-hooks/blob/v0.5.0/spago.dhall

I'm proposing that, when we find a package that has a Spago file but not a Bower file, we attempt to either:

  • parse the spago.dhall file to get the package license and dependencies
  • generate a bower.json file from the spago.dhall file, and then import the Bower file as usual

Activity

  1. thomashoneyman commented on Sep 16, 2021

    @thomashoneyman
    MemberAuthor

    As discussed briefly with @JordanMartinez on Discord, we may have to do some tweaking of files to make this work. For example:

    1. We have to fetch the packages.dhall file too, not just the spago.dhall file
    2. We have to update the metadata.version in the packages.dhall to match whatever version of Spago is being used to run the script (or to some fixed 0.14-compatible version)
    3. We may find ourselves fixing up more fields in the future, like parsing the LICENSE file in the root if there is no license key (see Parse LICENSE file if no license is listed in the Bowerfile #220), or setting the repository key if none is set in the Spago file.

    Or...rather than generating a bower.json file, maybe we just try to pull out the license key and rely on the output of spago ls deps for the list of project dependencies at specific versions?

    @f-f, would spago ls deps be a reliable way to get the package dependencies? Or is spago bump-version a better move?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions