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

Allow for the absence of an old version #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Allow for the absence of an old version #8

wants to merge 1 commit into from

Conversation

joshuahhh
Copy link

If you're publishing a package for the first time, you won't have a version yet.

(If you're publishing a package for the first time, you won't have a version yet.)
@tgvashworth
Copy link
Owner

Hi @joshuahhh — thanks for suggesting this.

I'm not sure it's the right thing to do in this situation. Is [no-version] a npm-standard placeholder? If not, I'd rather get the right version number. Something like this:

  • no version + npm-release patch -> 0.0.1
  • no version + npm-release minor -> 0.1.0
  • no version + npm-release major -> 1.0.0

The subsequent question is... what happens if you've already published that version? With that in mind, it seems the best thing is to error out.

In that case, the error message could be improved to say:

No version in package.json found.

Please give your package an initial version and `npm publish` it. We suggest `1.0.0`.

What are your thoughts?

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

Successfully merging this pull request may close these issues.

2 participants