purescript / spago

🍝 PureScript package manager and build tool
BSD 3-Clause "New" or "Revised" License
792 stars 132 forks source link

Use package from pursuit that doesn't have spago.yaml #1300

Closed flip111 closed 3 weeks ago

flip111 commented 3 weeks ago

I vaguely remember this might have been discussed somewhere before. But i'm not sure if it does have it's own ticket.

I like to use this package https://pursuit.purescript.org/packages/purescript-web-dom/6.0.0/docs/Web.DOM But than the latest version because of this commit https://github.com/purescript-web/purescript-web-dom/pull/59

I specify it like this

workspace:
  packageSet:
    registry: 60.7.0
  extraPackages:
    web-dom:
      git: https://github.com/purescript-web/purescript-web-dom.git
      ref: master

This is my console output

» spago run --backend-args '--help'
Reading Spago workspace configuration...

✓ Selecting package to build: html2halogen

Cloning https://github.com/purescript-web/purescript-web-dom.git

✘ Could not read config at .spago/p/web-dom/master
Error:
  Did not find `.spago/p/web-dom/master/spago.yaml`.

By the way, perhaps the error message can be improved a bit as well. As far as i understood the config must always be called "spago.yaml" so "could not read" and "did not find" seem a bit double. What about Could not find the spago.yaml config file in web-dom?

f-f commented 3 weeks ago

Happy to merge improvements to error messages.

Docs for this are here, quoting:

If the upstream library that you are adding has a spago.yaml file, then Spago will just pick up the dependencies from there. If that's not the case, then you'll have the provide the dependencies yourself, adding a dependencies field.

flip111 commented 3 weeks ago

ok got it. Why close the issue though? In this case there is a good workaround to which the error message could point. Is that not a todo worth of the issue being open?