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

Publish packages with dependencies #1215

Open
CGenie opened this issue Apr 15, 2024 · 6 comments
Open

Publish packages with dependencies #1215

CGenie opened this issue Apr 15, 2024 · 6 comments

Comments

@CGenie
Copy link

CGenie commented Apr 15, 2024

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
Copy link
Member

f-f commented Apr 15, 2024

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
Copy link
Author

CGenie commented Apr 15, 2024

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
Copy link
Member

f-f commented Apr 15, 2024

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
Copy link
Author

CGenie commented Apr 15, 2024

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

@f-f
Copy link
Member

f-f commented Apr 19, 2024

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

@CGenie
Copy link
Author

CGenie commented Apr 19, 2024

Sure

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

No branches or pull requests

2 participants