-
Notifications
You must be signed in to change notification settings - Fork 1.6k
doc(readme): update github and npm version badges #1872
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
Open
GitToTheHub
wants to merge
1
commit into
master
Choose a base branch
from
GitToTheHub-version-badges
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new badge we’ve been applying to some repos. I’d like to avoid having too many different badge designs and layouts, but there would still be some degree of confusion.
I also don't think we should be showing the "GitHub package.json version." If we do show it, it should at least be placed some where else, not next to the title.Maybe at the bottom of the README, or below the exisiting badge but in a table format and declaring it as an active development version.
Including it might reduce confusion for people reading the README in the repo, but it would still cause confusion for people viewing the package on the npm registry.
For example, if the repo is tagged as
16.0.0-dev, and that badge appeared in the14.0.1release, anyone reading the14.0.1page on npm might wonder why it shows16.0.0-devat the top.However, both the current badge and my suggested badge only report the latest official release. Even the current badge wouldnt accurately show the version that a user is installing.
Maybe the current badge I suggested should also include the label of "Latest Release" so its clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's another possible example: https://gist.github.com/erisu/2536f97976e64165c00a781888b0b6b4
Just ignore the two that displays as text. Some reason its not rendering correctly in the gist but renders OK in the repo.
Below the title, it shows the latest release on npm. The next row shows development related badges.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, the users on NPM would also see the development version in the title and would get confused. I started in my repos to manually add the current package version in the title like in https://github.com/katzer/cordova-plugin-local-notifications. But thought, maybe it could be made automatic, so you don't have to update it manually. This was my first try here to made it automatic and now see which disadvantage it have. I like your gist approach, but see you are using there also
shields.io. I didn't see onnodei.cothat it supports a label option. How would do you find it, to place manually the package version in the title? If the package gets published to npm the version would be correct.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I like on your approach is, that the users see on NPM that there is a development version which has recent development.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally prefer to avoid adding more places where version numbers need to be maintained within the repo.
We already have the version in
package.json,package-lock.json,RELEASENOTES.md(updated during release), and other files depending on the package.The more places we have to update, the higher the risk of forgetting one. I've had cases before—outside of Cordova—where I released a package and forgot to update a version in a file, simply because I didn't remember it existed. I ended up having to publish a patch just to fix that oversight.
If the badges are going to cause confusion, then I would rather remove them.
But this is just my opinion. You could try and ask if anyone else would be in favor of adding the version to the title or if they have any recommendations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid this, I always do a search in my IDE for the version i want to replace and this works very good. I don't have to remember all places, where to replace the version :)
What about your gist recommendation? I would take it over, but it's using
shields.ionotnodei.co