purescript / spago

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

Publish packages with dependencies #1215

Closed CGenie closed 4 months ago

CGenie commented 7 months ago

Hello,

Suppose I'm developing 2 libraries at once and one of them depends on the other. After publishing the first one (without the dependency), it seems I can't publish the second one until a new package set is published the next day. I can't publish a package with extraPackages in it and there yet isn't a new packageSet.registry version that I can put in the second package.

Or am I missing something here?

f-f commented 7 months ago

You can add the newly published library to the extraPackages just fine if you refer to the registry version instead of pointing to the url of the repo, e.g.

workspace:
  extraPackages:
    newly-published-library: 0.0.1
CGenie commented 7 months ago

OK this works, thanks!

Though this leaves the package YAML file in a somewhat intermediate definition where some of the packages are specified in dependencies and some in extraPackages. And there seems no way to fix that. Suppose the registry catches up with a new version. Then I can edit my library and move newly-published-library to dependencies but then I need to release a new version of that library. So I could have waited one day and made fewer releases anyways...

f-f commented 7 months ago

I don't understand - you're supposed to have newly-published-library in your dependencies all along if your code depends on it, and the registry even forces you to include ranges for it. The Registry entirely ignores the extraPackages key, and it only goes off the list of dependencies that your package has. In other words, your package being listed in extraPackages doesn't matter to the Registry for publishing. Spago first, and the Registry later, should fail the publish if your package doesn't include all the packages it needs to compile the source.

What am I missing here?

CGenie commented 7 months ago

Ah, ok, I guess that's fine then, thanks for the explanation.

f-f commented 7 months ago

You're welcome. I think we should be documenting this better - would you like to put together a small paragraph about this?

CGenie commented 7 months ago

Sure

CGenie commented 4 months ago

Can this be merged?

f-f commented 4 months ago

Ah sorry, I meant to leave a review but I lost track of it