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

[Feature Request] publish using version argument #280

Closed
oliver-oloughlin opened this issue Mar 13, 2024 · 5 comments
Closed

[Feature Request] publish using version argument #280

oliver-oloughlin opened this issue Mar 13, 2024 · 5 comments
Labels
publishing Problems with publishing

Comments

@oliver-oloughlin
Copy link

The issue
Right now, as far as I can tell, the version of a package must be set in a config json. Be that deno.json, jsr.json or other. I miss the ability to control the version of my package outside of the package itself, specifically through a GitHub workflow that gets triggered on publishing a new release. This creates the possibility of my release version and package version being out of sync (something that I have already done by mistake).

The solution
I suggest that the publish command has a --version flag that can be optionally used to provide the new version instead of including it in the config file. I primarily want to be able to pass the exact version number, but it might also be useful to pass patch, minor or major to automatically increment the version.

Potential issues

  • A --version argument should probably not override an existing version entry in the package config, as I imagine that could create issues or confusion when downloading a specific version of the package where the config file says it's another version.
  • Setting a version through an argument could allow publishing the exact same code as a new version, multiple times. Maybe this could be solved through analyzing the contents and recognizing duplicate versions?
@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Mar 13, 2024
@lucacasonato
Copy link
Member

Yes this feature makes sense to me. I think we should just hard error if the --version flag is passed, if there is also a version field specified in the config file.

Additionally, we'd still require specifying versions for individual packages when publishing a workspace.

@lucacasonato lucacasonato added feature publishing Problems with publishing labels Mar 14, 2024
@lucacasonato lucacasonato moved this from Needs Triage to Ready in JSR Mar 14, 2024
@oliver-oloughlin
Copy link
Author

I agree that hard error in the case of --version flag and version field makes the most sense.

@wojpawlik
Copy link

Resolved by denoland/deno#26141. Related: #544, #555.

@NathanFlurry
Copy link

Related bug: denoland/deno#27428

@dsherret
Copy link
Member

This is implemented as of #868

To use it, remove the version field from the jsr.json/deno.json and then use the --set-version <verison> flag.

Also, I'd recommend checking out https://github.com/dsherret/jsr-publish-on-tag/

@github-project-automation github-project-automation bot moved this from Ready to Done in JSR Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
publishing Problems with publishing
Projects
Status: Done
Development

No branches or pull requests

5 participants