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

Add support for publishing to the PureScript registry #850

Closed
thomashoneyman opened this issue Feb 6, 2022 · 6 comments
Closed

Add support for publishing to the PureScript registry #850

thomashoneyman opened this issue Feb 6, 2022 · 6 comments

Comments

@thomashoneyman
Copy link
Member

Users of current Spago will not be able to use the PureScript registry until they upgrade to a new config format as tracked in #842. However, they can still publish to the registry using the registry's legacy mode.

Spago should either update the publish command to push to both the new registry and to Pursuit, or add a new command that allows users to generate a .purs.json file and publish to the new registry. That way, current Spago users can still publish their packages even if they aren't yet using the new registry.

@thomashoneyman
Copy link
Member Author

Whatever decision we make for Spago should be mirrored to Pulp:
purescript-contrib/pulp#397

@f-f
Copy link
Member

f-f commented Feb 6, 2022

We don't have a publish command yet. So this issue should be tracking the addition of a publish command.
This command would:

  1. get the latest tag committed in the repo, and verify if it's in the registry-index (we'd clone this repo and keep it in the global cache, refreshing it before doing any publishing)
  2. if it's there it should error out and ask the user to tag a new release
  3. if it's not then it would create an Addition with the new version and in legacy mode

Depending on what we decide to do in purescript/registry#327 then before step (3) we'd also build the project, take the build plan, and feed it to the API inside the Addition, so that CI would be able to build Pursuit docs.

In this way we would not have to push to Pursuit directly, nor we'd have to generate a .purs.json file (which we can't yet since we'd have to invent version bounds)

@f-f
Copy link
Member

f-f commented Feb 6, 2022

Whatever decision we make for Spago should be mirrored to Pulp

Should it? If I understand correctly our aim in implementing the publishing flow now is to (1) validate the design and (2) provide a first migration path for folks already willing to publish on the registry. This means that we need at least one client implementing some sort of flow, but we're not required to fix all of them right now

@thomashoneyman
Copy link
Member Author

We don't have a publish command yet.

Sorry, I was thinking of the bump-version command which generates a bower.json file in preparation for a release. The Bowerfile is necessary because you can't publish to Pursuit without it.

In this way we would not have to push to Pursuit directly, nor we'd have to generate a .purs.json file (which we can't yet since we'd have to invent version bounds)

The user has to commit either a bower.json or .purs.json file in order to publish to Pursuit. We can certainly publish to the registry without these files, but the registry couldn't then publish their package to Pursuit. We're having a parallel discussion about that here:

purescript/registry#327 (comment)

If a Spago user just wants to publish to the new registry and doesn't care that their package will not be propagated to Pursuit, then they don't need a .purs.json file.

nor we'd have to generate a .purs.json file (which we can't yet since we'd have to invent version bounds)

One way or another a .purs.json file is generated, using generated version bounds. If you publish a Spago project without a manifest, then the registry will generate a .purs.json manifest file for you where the version bounds are the exact versions indicated by the package set. This is almost guaranteed to be overly restrictive.

This is one reason why it may be better for Spago to generate a manifest for the user and ask them to commit it: they can edit the bounds to something sensible. Spago already does this with Bowerfiles.

@thomashoneyman
Copy link
Member Author

Whatever decision we make for Spago should be mirrored to Pulp

Should it? If I understand correctly our aim in implementing the publishing flow now is to (1) validate the design and (2) provide a first migration path for folks already willing to publish on the registry. This means that we need at least one client implementing some sort of flow, but we're not required to fix all of them right now

This is a bit off-topic for spago publish, so we can take this conversation elsewhere (like the Pulp issue) if you'd like.

I'm not saying that we need Pulp to be able to publish to the new registry now, and we can start with just Spago. However, I'm saying that we shouldn't leave Pulp users without a way to publish to the new registry long-term.

We don't have good usage statistics on the relative use of Spago vs. Pulp; my gut sense is that there are many more Spago users, but the NPM weekly downloads for the two tools are basically the same, so clearly there are still a lot of Pulp users out there. I would like Pulp users to be able to publish to the new registry also. It's easier for them, in fact, because their bower.json file dodges the issues that Spago has with having to generate a manifest.

@f-f
Copy link
Member

f-f commented Sep 20, 2023

This is DONE 🙂

@f-f f-f closed this as completed Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants