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

fix: Recommend --tag when publishing prerelease npm modules #189

Closed
wants to merge 1 commit into from
Closed

fix: Recommend --tag when publishing prerelease npm modules #189

wants to merge 1 commit into from

Conversation

tmcw
Copy link
Contributor

@tmcw tmcw commented Jun 5, 2017

The --tag argument to npm publish allows you to publish a prerelease without the prerelease assuming
the 'latest' tag and causing users to download the prerelease by default. Instead, we recommend
--tag prerelease by default when --prerelease is set in the standard-version call, so to
install a prerelease version of the module, users will install module@foo or specify the exact
version of the prerelease version.

Fixes #183

@tmcw
Copy link
Contributor Author

tmcw commented Jun 5, 2017

Quick notes:

  • Considered a few approaches for what to name the tag, but prerelease seems to make sense. standard-version --prerelease without an arg generates, for instance, 1.0.0-0, so simply tagging the semver tag (npm install foo@0) doesn't work that well. Similarly, next would imply a major version bump, I think, so prerelease is the closest to the desired meaning.
  • There isn't test coverage for output. Adding it would be a more invasive change, so I don't include that in this PR.

@coveralls
Copy link

coveralls commented Jun 5, 2017

Coverage Status

Coverage increased (+0.0007%) to 99.614% when pulling fda4e04 on tmcw:advise-prerelease-tag into dfd1d12 on conventional-changelog:master.

@stevemao
Copy link
Member

stevemao commented Jun 6, 2017

Thanks a lot! Could you add a simple test for that?

The --tag argument to npm publish allows you to publish a prerelease without the prerelease assuming
the 'latest' tag and causing users to download the prerelease by default. Instead, we recommend
`--tag prerelease` by default when `--prerelease` is set in the `standard-version` call, so to
install a prerelease version of the module, users will install `module@foo` or specify the exact
version of the prerelease version.
@tmcw
Copy link
Contributor Author

tmcw commented Jun 6, 2017

Can do! I added the ability to test for output, by adding a Symbol key to the args object. It's the least invasive way and should avoid futurebugs around any new arguments, including arguments named messages. Open to other approaches if anyone sees other drawbacks to that testing approach.

@bcoe
Copy link
Member

bcoe commented Jun 6, 2017

@tmcw thanks for this 👍 unfortunately (fortunately) I just finished a pretty big overhaul of standard-version so I think you might need to rebase.

Would love your thoughts on this old issue, regarding how we should generate a CHANGELOG for pre-releases.

@stevemao
Copy link
Member

stevemao commented Jun 6, 2017

@tmcw Is there a way to use stdout just like other tests?

@tmcw
Copy link
Contributor Author

tmcw commented Jun 23, 2017

Superseded by #196 which uses stdout to make testing much simpler.

@tmcw tmcw closed this Jun 23, 2017
@tmcw tmcw deleted the advise-prerelease-tag branch June 23, 2017 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants