Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tracked by #216
thomashoneyman opened this issue Sep 9, 2021 · 1 comment · Fixed by #240
Closed
Tracked by #216

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

thomashoneyman opened this issue Sep 9, 2021 · 1 comment · Fixed by #240
Assignees

Comments

@thomashoneyman
Copy link
Member

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
@thomashoneyman
Copy link
Member Author

thomashoneyman commented Sep 16, 2021

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